Exemplo n.º 1
0
 public function testDistinct()
 {
     $stream = new S\Stream(array(1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4));
     $newStream = $stream->distinct();
     $this->assertInstanceOf('Streams\\Stream', $newStream);
     $this->assertEquals($newStream->getElements(), array(1, 2, 3, 4));
     $stream = new S\Stream(array(4, 5, 6, 7, 4, 5, 6, 7));
     $newStream = $stream->distinct();
     $this->assertInstanceOf('Streams\\Stream', $newStream);
     $this->assertEquals($newStream->getElements(), array(4, 5, 6, 7));
 }