/** * Testing that you can add a DAO directly to the cache without saving. * * @since 1.2.3 */ public function testAddToCache() { $config = ConfigProvider::getInstance(); $oldSetting = $config->get('cache.provider.name'); $config->set('cache.provider.name', 'Alpha\\Util\\Cache\\CacheProviderArray'); $this->person->setOID('123'); $this->person->addToCache(); $fromCache = new Person(); $fromCache->setOID($this->person->getOID()); $this->assertTrue($fromCache->loadFromCache(), 'testing that the item loads from the cache'); $this->assertEquals('unitTestUser', $fromCache->get('displayName', true), 'testing that you can add a DAO directly to the cache without saving'); $config->set('cache.provider.name', $oldSetting); }