CacheTest::testCacheMongoFlush PHP Method

testCacheMongoFlush() public method

public testCacheMongoFlush ( )
    public function testCacheMongoFlush()
    {
        // Mongo
        list($ready, $collection) = $this->_prepareMongo();
        if (!$ready) {
            return false;
        }
        $frontCache = new Phalcon\Cache\Frontend\Data(array('lifetime' => 10));
        $cache = new Phalcon\Cache\Backend\Mongo($frontCache, array('mongo' => $ready, 'db' => 'phalcon_test', 'collection' => 'caches'));
        $cache->save('data', "1");
        $cache->save('data2', "2");
        $this->assertTrue($cache->flush());
        $this->assertFalse($cache->exists('data'));
        $this->assertFalse($cache->exists('data2'));
    }