collect() public method

public collect ( phpstreams\Collector $collector )
$collector phpstreams\Collector
Example #1
0
 /**
  * Test the collect method.
  */
 public function testCollect()
 {
     $instance = new Stream([1, 2, 3, 4]);
     $collector = $this->getMockBuilder('phpstreams\\Collector')->getMock();
     $collector->expects($this->exactly(4))->method('add');
     $collector->expects($this->once())->method('get')->willReturn(42);
     $this->assertEquals(42, $instance->collect($collector));
 }