function ViewExecutableTest::testSetItemsPerPageBeforePreRender

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Unit/ViewExecutableTest.php \Drupal\Tests\views\Unit\ViewExecutableTest::testSetItemsPerPageBeforePreRender()
  2. 10 core/modules/views/tests/src/Unit/ViewExecutableTest.php \Drupal\Tests\views\Unit\ViewExecutableTest::testSetItemsPerPageBeforePreRender()
  3. 11.x core/modules/views/tests/src/Unit/ViewExecutableTest.php \Drupal\Tests\views\Unit\ViewExecutableTest::testSetItemsPerPageBeforePreRender()

@covers ::setItemsPerPage @covers ::getItemsPerPage

File

core/modules/views/tests/src/Unit/ViewExecutableTest.php, line 583

Class

ViewExecutableTest
@coversDefaultClass \Drupal\views\ViewExecutable @group views

Namespace

Drupal\Tests\views\Unit

Code

public function testSetItemsPerPageBeforePreRender() {
    
    /** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
    
    /** @var \Drupal\views\Plugin\views\display\DisplayPluginBase|\PHPUnit\Framework\MockObject\MockObject $display */
    [
        $view,
        $display,
    ] = $this->setupBaseViewAndDisplay();
    $view->setItemsPerPage(12);
    $this->assertEquals(12, $view->getItemsPerPage());
    $this->assertContains('items_per_page:12', $view->element['#cache']['keys']);
}

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