getIterator() public method

Beispiel #1
0
 public function testPagerGetIteratorMethodWillCreateIteratorIfArrayIsPassed()
 {
     // stub paginate
     $paginate = new stdClass();
     $paginate->total_pages = 20;
     $paginate->current = 10;
     $paginate->items = [1, 2, 4, 5];
     $mock = Mockery::mock(self::BUILDER_CLASS);
     $mock->shouldReceive('getPaginate')->once()->andReturn($paginate);
     $mock->shouldReceive('getLimit')->once()->andReturn(null);
     $pager = new Pager($mock, ['rangeLength' => 5, 'urlMask' => 'xxx']);
     $this->assertInstanceOf('Iterator', $pager->getIterator());
 }