Exemplo n.º 1
0
 public function testFilter()
 {
     $seq = new Sequence([1, 2, 3]);
     $newSeq = $seq->filter(function ($n) {
         return $n === 2;
     });
     $this->assertNotSame($newSeq, $seq);
     $this->assertCount(3, $seq);
     $this->assertCount(1, $newSeq);
     $this->assertSame(2, $newSeq->get(0));
 }