Ejemplo n.º 1
0
 /**
  * Testing the removeFromCache method.
  *
  * @since 1.2.1
  * @dataProvider getActiveRecordProviders
  */
 public function testRemoveFromCache($provider)
 {
     $config = ConfigProvider::getInstance();
     $config->set('db.provider.name', $provider);
     $config = ConfigProvider::getInstance();
     $oldSetting = $config->get('cache.provider.name');
     $config->set('cache.provider.name', 'Alpha\\Util\\Cache\\CacheProviderArray');
     $this->person->save();
     $fromCache = new Person();
     $fromCache->setOID($this->person->getOID());
     $this->assertTrue($fromCache->loadFromCache(), 'testing that the item loads from the cache');
     $fromCache->removeFromCache();
     $this->assertFalse($fromCache->loadFromCache(), 'testing that the item is gone from the cache');
     $config->set('cache.provider.name', $oldSetting);
 }