lithium\tests\integration\storage\cache\adapter\MemcacheTest::testWriteNoExpiry PHP Method

testWriteNoExpiry() public method

public testWriteNoExpiry ( )
    public function testWriteNoExpiry()
    {
        $keys = array('key1' => 'data1');
        $adapter = new Memcache(array('expiry' => null));
        $expiry = null;
        $result = $adapter->write($keys, $expiry);
        $this->assertTrue($result);
        $result = (bool) $this->_conn->get('key1');
        $this->assertTrue($result);
        $this->_conn->delete('key1');
        $adapter = new Memcache(array('expiry' => Cache::PERSIST));
        $expiry = Cache::PERSIST;
        $result = $adapter->write($keys, $expiry);
        $this->assertTrue($result);
        $result = (bool) $this->_conn->get('key1');
        $this->assertTrue($result);
        $this->_conn->delete('key1');
        $adapter = new Memcache();
        $expiry = Cache::PERSIST;
        $result = $adapter->write($keys, $expiry);
        $this->assertTrue($result);
        $result = (bool) $this->_conn->get('key1');
        $this->assertTrue($result);
        $this->_conn->delete('key1');
    }