示例#1
0
 /**
  * @dataProvider everything
  */
 public function testIterateWillStopAfterReturningFalse(\Pinq\ITraversable $traversable, array $data)
 {
     if ($traversable->count() < 3) {
         return;
     }
     $count = 0;
     $traversable->iterate(function ($value, $key) use(&$count) {
         $count++;
         //Must use strict equality
         if ($count === 1) {
             return '';
         } elseif ($count === 2) {
             return 0;
         } elseif ($count === 3) {
             return false;
         }
     });
     $this->assertSame($count, 3);
 }
示例#2
0
 public function visitCount(Requests\Count $request)
 {
     return $this->traversable->count();
 }
示例#3
0
 /**
  * @dataProvider everything
  */
 public function testThatCountReturnsTheAmountOfElements(\Pinq\ITraversable $traversable, array $data)
 {
     $this->assertSame($traversable->count(), count($data));
 }