Phalcon\Test\Annotations\Adapter\BaseTest::testWriteAnnotations PHP Method

testWriteAnnotations() public method

public testWriteAnnotations ( string $key, mixed $data )
$key string
$data mixed
    public function testWriteAnnotations($key, $data)
    {
        $mock = $this->getObject(null);
        $mock->expects($this->once())->method('prepareKey')->willReturn($key);
        $cacheBackend = new CacheBackend(new CacheFrontend(['lifetime' => 86400]));
        $mock->expects($this->once())->method('getCacheBackend')->willReturn($cacheBackend);
        $mock->write($key, $data, 86400);
        $this->assertEquals($data, $cacheBackend->get($key));
    }