lithium\tests\cases\storage\cache\adapter\FileTest::testWriteWithScope PHP Method

testWriteWithScope() public method

public testWriteWithScope ( )
    public function testWriteWithScope()
    {
        $now = time();
        $adapter = new File(array('scope' => 'primary'));
        $time = $now + 5;
        $expiry = 5;
        $keys = array('key1' => 'test1');
        $adapter->write($keys, $expiry);
        $file = Libraries::get(true, 'resources') . '/tmp/cache/primary_key1';
        $expected = "{:expiry:{$time}}\ntest1";
        $result = file_get_contents($file);
        $this->assertEqual($expected, $result);
    }