function SqlBaseTest::testQuery
Tests the query() method.
See also
\Drupal\views\Plugin\views\pager\SqlBase::query()
File
- 
              core/
modules/ views/ tests/ src/ Unit/ Plugin/ pager/ SqlBaseTest.php, line 67  
Class
- SqlBaseTest
 - @coversDefaultClass \Drupal\views\Plugin\views\pager\SqlBase[[api-linebreak]] @group views
 
Namespace
Drupal\Tests\views\Unit\Plugin\pagerCode
public function testQuery() {
  $request = new Request([
    'items_per_page' => 'All',
  ]);
  $this->view
    ->expects($this->any())
    ->method('getRequest')
    ->will($this->returnValue($request));
  $options = [];
  $this->pager
    ->init($this->view, $this->display, $options);
  $this->pager
    ->query();
  $this->assertSame(10, $this->pager->options['items_per_page']);
  $options = [
    'expose' => [
      'items_per_page' => TRUE,
      'items_per_page_options_all' => TRUE,
    ],
  ];
  $this->pager
    ->init($this->view, $this->display, $options);
  $this->pager
    ->query();
  $this->assertSame(0, $this->pager->options['items_per_page']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.