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

testSimpleRead() public method

public testSimpleRead ( )
    public function testSimpleRead()
    {
        $key = 'read_key';
        $data = 'read data';
        $keys = array($key);
        $time = strtotime('+1 minute');
        $result = xcache_set($key, $data, 60);
        $this->assertTrue($result);
        $expected = array($key => $data);
        $result = $this->XCache->read($keys);
        $this->assertEqual($expected, $result);
        $result = xcache_unset($key);
        $this->assertTrue($result);
        $key = 'another_read_key';
        $data = 'read data';
        $keys = array($key);
        $time = strtotime('+1 minute');
        $result = xcache_set($key, $data, 60);
        $this->assertTrue($result);
        $expected = array($key => $data);
        $result = $this->XCache->read($keys);
        $this->assertEqual($expected, $result);
        $result = xcache_unset($key);
        $this->assertTrue($result);
    }