function _pairs($object)
{
    return Underscore::pairs($object);
}
Beispiel #2
0
 /**
  * @tags objects
  */
 public function testPairs()
 {
     $array = ['a' => 1, 'b' => 2, 'c' => 3];
     $this->array(_::pairs($array))->isEqualTo([['a', 1], ['b', 2], ['c', 3]]);
     $object = new \stdClass();
     $object->a = 1;
     $object->b = 2;
     $object->c = 3;
     $this->array(_::pairs($object))->isEqualTo([['a', 1], ['b', 2], ['c', 3]]);
     $iterator = new \ArrayIterator(['a' => 1, 'b' => 2, 'c' => 3]);
     $this->array(_::pairs($iterator))->isEqualTo([['a', 1], ['b', 2], ['c', 3]]);
 }