Alex\BehatLauncher\Behat\ProjectProperty::mergeConfig PHP Method

mergeConfig() public method

public mergeConfig ( array $config, $value )
$config array
    public function mergeConfig(array $config, $value)
    {
        if ($this->config) {
            $config = $this->doMergeConfig($config, $value, $this->config);
        }
        return $config;
    }

Usage Example

 public function testConfig()
 {
     $property = new ProjectProperty();
     $property->setConfig('foo');
     $actual = array();
     $expected = array('foo' => 3);
     $config = $property->mergeConfig($actual, 3);
     $this->assertEquals($expected, $config);
     $property->setConfig('foo');
     $actual = array('foo' => 1);
     $expected = array('foo' => 3);
     $config = $property->mergeConfig($actual, 3);
     $this->assertEquals($expected, $config);
     $property->setConfig('foo.bar');
     $actual = array();
     $expected = array('foo' => array('bar' => 3));
     $config = $property->mergeConfig($actual, 3);
     $this->assertEquals($expected, $config);
     $property->setConfig('foo.bar');
     $actual = array('foo' => array('bar' => 2, 'baz' => 3));
     $expected = array('foo' => array('bar' => 3, 'baz' => 3));
     $config = $property->mergeConfig($actual, 3);
     $this->assertEquals($expected, $config);
 }