$configBuilder =
$this->
generateConfigBuilder(NodeInitialValues::
class);
$this->
expectException(InvalidConfigurationException::
class);
$configBuilder->
someCleverName(['not_exists' => 'foo'
]);
} public function testSetExtraKeyMethodIsNotGeneratedWhenAllowExtraKeysIsFalse() { /** @var AddToListConfig $configBuilder */
$configBuilder =
$this->
generateConfigBuilder(AddToList::
class);
$this->
assertFalse(method_exists($configBuilder->
translator(), 'set'
));
$this->
assertFalse(method_exists($configBuilder->
messenger()->
receiving(), 'set'
));
} /**
* Generate the ConfigBuilder or return an already generated instance.
*/
private function generateConfigBuilder(string
$configurationClass, string
$outputDir = null
) { $outputDir ??=
sys_get_temp_dir().\DIRECTORY_SEPARATOR.
uniqid('sf_config_builder', true
);
if (!
str_contains($outputDir, __DIR__
)) { $this->tempDir
[] =
$outputDir;
}