function _extend($destination, $sources) { return Underscore::extend($destination, $sources); }
/** * @tags objects */ public function testExtend() { // it should be able to extend an object, and be type tolerant $object = new \stdClass(); $object->a = 1; $this->object(_::extend($object, ['b' => 2], new \ArrayIterator(['c' => 3])))->isEqualTo((object) ['a' => 1, 'b' => 2, 'c' => 3]); // it should override the destination object with values from the sources, the last source being prioritary $this->array(_::extend([1], [2], [3], [4], [5]))->isEqualTo([5]); }