Example #1
0
 /**
  * @dataProvider getFirstPageLinks
  *
  * @param string|callback $page_link
  * @param string $first_page_link
  */
 public function testGetFirst($page_link, $first_page_link)
 {
     $this->config->expects($this->once())->method('getCurrentPage')->will($this->returnValue(10));
     $this->config->expects($first_page_link ? $this->atLeastOnce() : $this->once())->method('getFirstPageLink')->will($this->returnValue($first_page_link));
     $this->config->expects($first_page_link ? $this->never() : $this->atLeastOnce())->method('getPageLink')->will($this->returnValue($page_link));
     $node = $this->view->getFirst();
     $this->assertInstanceOf(Node::class, $node);
     $this->assertEquals(1, $node->getPage());
     if ($first_page_link) {
         $this->assertEquals($first_page_link, $node->getLink());
     } else {
         $this->assertEquals($this->getLink($page_link, 1), $node->getLink());
     }
 }