Phalcon\Test\Unit\Cache\Backend\ApcCest::get PHP Method

get() public method

public get ( UnitTester $I )
$I UnitTester
    public function get(UnitTester $I)
    {
        $I->wantTo('Get data by using APC(u) as cache backend');
        $key = '_PHCA' . 'data-get';
        $data = [uniqid(), gethostname(), microtime(), get_include_path(), time()];
        $cache = new Apc(new Data(['lifetime' => 20]));
        $I->haveInApc($key, serialize($data));
        $I->assertEquals($data, $cache->get('data-get'));
        $I->assertNull($cache->get('non-existent-key'));
        $data = 'sure, nothing interesting';
        $I->haveInApc($key, serialize($data));
        $I->assertEquals($data, $cache->get('data-get'));
        $I->assertNull($cache->get('non-existent-key-2'));
    }