Exemplo n.º 1
0
 public function testPrependTo()
 {
     $p1 = P::prependTo([2, 3]);
     $this->assertEquals([1, 2, 3], P::toArray(P::prependTo([2, 3], 1)));
     $this->assertEquals([[1], 2, 3], P::toArray(P::prependTo([2, 3], [1])));
     $this->assertEquals([1, 2, 3], P::toArray($p1(1)));
     $a = function () {
         (yield 2);
         (yield 3);
     };
     $this->assertEquals([1, 2, 3], P::toArray(P::prependTo($a(), 1)));
 }