public function testMerge() { $this->object->addConstants(array('first' => 'to overwrite', 'second' => 'cannot be overwritten')); $this->object->define('First')->setClass('To_Overwrite'); $second = $this->object->define('Second'); $builder = new ContainerBuilder(); $builder->addConstants(array('first' => 'new value', 'third' => 'unseen')); $first = $builder->define('First')->setClass('Write_It_Over'); $third = $builder->define('Third'); $this->object->merge($builder); $this->assertThat($this->object->getConstants(), $this->equalTo(array('first' => 'new value', 'second' => 'cannot be overwritten', 'third' => 'unseen'))); $this->assertThat($this->object->getDefinitions(), $this->equalTo(array('First' => $first, 'Second' => $second, 'Third' => $third))); }