/** * @dataProvider configSectionProvider */ public function testConfigWhenIsSetExplicitlyForKnownSection($configSection) { $sectionConfig = ConfigUtil::getInitialConfig(); $this->context->setClassName('Test\\Class'); // set "known" sections $this->context->setConfigExtras([new FiltersConfigExtra(), new SortersConfigExtra()]); $this->configProvider->expects($this->never())->method('getConfig'); $suffix = lcfirst($configSection); $this->context->{'setConfigOf' . $suffix}($sectionConfig); $this->assertTrue($this->context->{'hasConfigOf' . $suffix}()); $this->assertEquals($sectionConfig, $this->context->{'getConfigOf' . $suffix}()); foreach ($this->context->getConfigExtras() as $configExtra) { if ($configExtra instanceof ConfigExtraSectionInterface && $configExtra->getName() !== $configSection) { $this->assertTrue($this->context->{'hasConfigOf' . lcfirst($configExtra->getName())}()); $this->assertNull($this->context->{'getConfigOf' . lcfirst($configExtra->getName())}()); } } $this->assertTrue($this->context->hasConfig()); $this->assertNull($this->context->getConfig()); }