lithium\tests\cases\storage\cache\adapter\XCacheTest::testWriteNoExpiry PHP Method

testWriteNoExpiry() public method

public testWriteNoExpiry ( )
    public function testWriteNoExpiry()
    {
        $keys = array('key1' => 'data1');
        $adapter = new XCache(array('expiry' => null));
        $expiry = null;
        $result = $adapter->write($keys, $expiry);
        $this->assertTrue($result);
        $result = xcache_isset('key1');
        $this->assertTrue($result);
        xcache_unset('key1');
        $adapter = new XCache(array('expiry' => Cache::PERSIST));
        $expiry = Cache::PERSIST;
        $result = $adapter->write($keys, $expiry);
        $this->assertTrue($result);
        $result = xcache_isset('key1');
        $this->assertTrue($result);
        xcache_unset('key1');
        $adapter = new XCache();
        $expiry = Cache::PERSIST;
        $result = $adapter->write($keys, $expiry);
        $this->assertTrue($result);
        $result = xcache_isset('key1');
        $this->assertTrue($result);
    }