/** * Get the items per page from the pager. */ public function getItemsPerPage() { // If the pager is already initialized, pass it through to the pager. if (!empty($this->pager)) { return $this->pager->getItemsPerPage(); } if (isset($this->items_per_page)) { return $this->items_per_page; } }
/** * Tests the setItemsPerPage() method. * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::setItemsPerPage() */ public function testSetItemsPerPage() { $this->pager->setItemsPerPage(6); $this->assertEquals(6, $this->pager->getItemsPerPage()); }