public function testGetInitialConfigHash() { $config = ['foo' => 'bar', 'bat' => 'baz']; $hash = md5(serialize($config)); $systemConfig = new SystemConfig($config); $this->assertSame($hash, $systemConfig->getInitialConfigHash()); }
public function testConfigureNamespace() { $systemConfig = new SystemConfig(); $configHash = $systemConfig->getInitialConfigHash(); $listener = $this->getMock(ConfigureCacheListener::CLASS, ['getCache']); $listener->setConfig($systemConfig); $cache = $this->getMock(FileCache::CLASS); $listener->expects($this->once())->method('getCache')->will($this->returnValue($cache)); $cache->expects($this->once())->method('get')->with($this->identicalTo('hash'))->will($this->returnValue('foo')); $cache->expects($this->once())->method('clearNamespace'); $cache->expects($this->once())->method('set')->with($this->identicalTo('hash'), $this->identicalTo($configHash)); $listener->configureNamespace(new SystemEvent()); }