function PagerPluginBaseTest::setUp

Same name in other branches
  1. 9 core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\pager\PagerPluginBaseTest::setUp()
  2. 8.9.x core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\pager\PagerPluginBaseTest::setUp()
  3. 10 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

Class

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

Namespace

Drupal\Tests\views\Unit\Plugin\pager

Code

protected function setUp() : void {
    parent::setUp();
    $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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.