Example #1
0
 /**
  * @dataProvider getPageLinks
  *
  * @param string|callback $page_link
  */
 public function testGetNext($page_link)
 {
     $this->config->expects($this->atLeastOnce())->method('getCurrentPage')->will($this->returnValue(5));
     $this->config->expects($this->atLeastOnce())->method('getTotalPages')->will($this->returnValue(10));
     $this->config->expects($this->never())->method('getFirstPageLink')->will($this->returnValue(''));
     $this->config->expects($this->atLeastOnce())->method('getPageLink')->will($this->returnValue($page_link));
     $node = $this->view->getNext();
     $this->assertInstanceOf(Node::class, $node);
     $this->assertEquals(6, $node->getPage());
     $this->assertEquals($this->getLink($page_link, 6), $node->getLink());
 }