function _union()
{
    return Underscore::union();
}
예제 #2
0
 /**
  * @tags arrays
  */
 public function testUnion()
 {
     // it should compute the union of the passed-in arrays
     $values = [['a' => 1, 'b' => 2], ['c' => 2, 'd' => 3], ['e' => 3, 'f' => 4]];
     $this->typeTolerant($values, [1, 2, 3, 4], function ($in, $out) {
         $in = _::toArray($in);
         $this->array(_::union($in[0], $in[1], $in[2]))->isEqualTo($out);
     }, [1, -1]);
     // it should be capable to compute unions of different type
     $this->array(_::union($values[0], self::toObject($values[1]), self::toIterator($values[2])))->isEqualTo([1, 2, 3, 4]);
 }