public function ViewExecutableTest::testSetItemsPerPageDuringPreRender in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/tests/src/Unit/ViewExecutableTest.php \Drupal\Tests\views\Unit\ViewExecutableTest::testSetItemsPerPageDuringPreRender()
@covers ::setItemsPerPage @covers ::getItemsPerPage
File
- core/
modules/ views/ tests/ src/ Unit/ ViewExecutableTest.php, line 490 - Contains \Drupal\Tests\views\Unit\ViewExecutableTest.
Class
- ViewExecutableTest
- @coversDefaultClass \Drupal\views\ViewExecutable @group views
Namespace
Drupal\Tests\views\UnitCode
public function testSetItemsPerPageDuringPreRender() {
/** @var \Drupal\views\ViewExecutable|\PHPUnit_Framework_MockObject_MockObject $view */
/** @var \Drupal\views\Plugin\views\display\DisplayPluginBase|\PHPUnit_Framework_MockObject_MockObject $display */
list($view, $display) = $this
->setupBaseViewAndDisplay();
$elements =& $view->element;
$elements['#cache'] += [
'keys' => [],
];
$elements['#pre_rendered'] = TRUE;
$view
->setItemsPerPage(12);
$this
->assertEquals(12, $view
->getItemsPerPage());
$this
->assertNotContains('items_per_page:12', $view->element['#cache']['keys']);
}