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

save() public method

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