/** * Test if we get pack right config if a default config was * set before. It should merge the config together, but the * config, which was set by the request will overwrite the default * config * */ function testMergingWithDefaultConfig() { $config = ['level1' => ['level2' => ['level3' => null, 'other' => 'otherValue']]]; $default = array('type' => 'defaultType', 'level1' => array('level2' => array('level3' => 'notWorth', 'type' => 'defaultLevel2Type'))); /** * both array should be merged together to this * * array( * 'type' => 'defaultType', * 'level1' => array( * 'level2' => array( * 'level3' => null, * 'type' => 'defaultLevel2Type', * 'other' => 'otherValue' * ) * ) * ); * */ $configParser = new OptionAccessor(); $configParser->setDefaults($default); $configParser->resolve($config); $this->assertEquals('defaultType', $configParser->get('type')); $this->assertArraySubset(array('level3' => null, 'other' => 'otherValue', 'type' => 'defaultLevel2Type'), $configParser->get('level1.level2')); }
public function configureOptions(OptionAccessor $optionsAccessor) { $optionsAccessor->setDefaults(['translationDomain' => null]); }
public function configureOptions(OptionAccessor $optionsAccessor) { $optionsAccessor->setDefaults(['strategy' => 'service', 'service' => 'enhavo_app.preview.default_renderer:renderTest']); }