public function testSetNestedPath() { $input_array = array('foo' => array('bar' => 'some_value')); $output_array = array('foo' => array('bar' => 'some_value', 'new' => array('node' => array('value' => 'new_value')))); $result = ArrayUtils::set($input_array, 'foo.new.node.value', 'new_value'); $this->assertSame($output_array, $input_array); // Set returns just the added bit: $this->assertSame(array('value' => 'new_value'), $result); }