lithium\tests\cases\storage\cache\adapter\FileTest::testWrite PHP Метод

testWrite() публичный Метод

public testWrite ( )
    public function testWrite()
    {
        $key = 'key';
        $data = 'data';
        $keys = array($key => $data);
        $time = time();
        $expiry = "@{$time} +1 minute";
        $time = $time + 60;
        $expected = 25;
        $result = $this->File->write($keys, $expiry);
        $this->assertEqual($expected, $result);
        $this->assertFileExists(Libraries::get(true, 'resources') . "/tmp/cache/{$key}");
        $this->assertEqual(file_get_contents(Libraries::get(true, 'resources') . "/tmp/cache/{$key}"), "{:expiry:{$time}}\ndata");
        $this->assertTrue(unlink(Libraries::get(true, 'resources') . "/tmp/cache/{$key}"));
        $this->assertFileNotExists(Libraries::get(true, 'resources') . "/tmp/cache/{$key}");
    }