public function testGetItemsDelegatesToGetIterator() { $query = $this->getMockQuery(); $query->expects($this->once())->method('setFirstResult')->with(10)->will($this->returnSelf()); $query->expects($this->once())->method('setMaxResults')->with(2)->will($this->returnSelf()); $paginator = $this->getMockPaginator(); $paginator->method('getQuery')->willReturn($query); $paginator->expects($this->once())->method('getIterator')->willReturn(new \ArrayIterator($expected = array('foo', 'bar'))); $adapter = new DqlAdapter($paginator); $this->assertSame($expected, $adapter->getItems(10, 2)); }
/** * {@inheritDoc} * * @api */ public function getItems($offset, $limit) { return $this->adapter->getItems($offset, $limit); }