You are here

protected function PagerPluginBaseTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\pager\PagerPluginBaseTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php, line 27
Contains \Drupal\Tests\views\Unit\Plugin\pager\PagerPluginBaseTest.

Class

PagerPluginBaseTest
@coversDefaultClass \Drupal\views\Plugin\views\pager\PagerPluginBase @group views

Namespace

Drupal\Tests\views\Unit\Plugin\pager

Code

protected function setUp() : void {
  $this->pager = $this
    ->getMockBuilder('Drupal\\views\\Plugin\\views\\pager\\PagerPluginBase')
    ->disableOriginalConstructor()
    ->getMockForAbstractClass();
  $view = $this
    ->getMockBuilder('Drupal\\views\\ViewExecutable')
    ->disableOriginalConstructor()
    ->getMock();
  $display = $this
    ->getMockBuilder('Drupal\\views\\Plugin\\views\\display\\DisplayPluginBase')
    ->disableOriginalConstructor()
    ->getMock();
  $options = [
    'items_per_page' => 5,
    'offset' => 1,
  ];
  $this->pager
    ->init($view, $display, $options);
  $this->pager->current_page = 1;
}