Example #1
0
 public function testConfigWhenItIsSetExplicitly()
 {
     $config = ConfigUtil::getInitialConfig();
     $this->context->setConfigExtras([new TestConfigSection('section1')]);
     $this->context->setClassName('Test\\Class');
     $this->configProvider->expects($this->never())->method('getConfig');
     $this->context->setConfig($config);
     $this->assertTrue($this->context->hasConfig());
     $this->assertEquals($config, $this->context->getConfig());
     $this->assertTrue($this->context->has(Context::CONFIG_PREFIX . ConfigUtil::DEFINITION));
     $this->assertEquals($config, $this->context->get(Context::CONFIG_PREFIX . ConfigUtil::DEFINITION));
     $this->assertTrue($this->context->hasConfigOf('section1'));
     $this->assertNull($this->context->getConfigOf('section1'));
     $this->assertTrue($this->context->has(Context::CONFIG_PREFIX . 'section1'));
     $this->assertNull($this->context->get(Context::CONFIG_PREFIX . 'section1'));
 }