function ViewExecutableTest::testSetOffsetDuringPreRender
Tests set offset during pre render.
@legacy-covers ::setOffset @legacy-covers ::getOffset
File
-
core/
modules/ views/ tests/ src/ Unit/ ViewExecutableTest.php, line 668
Class
Namespace
Drupal\Tests\views\UnitCode
public function testSetOffsetDuringPreRender() : void {
/** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
$view = current($this->setupBaseViewAndDisplay());
$elements =& $view->element;
$elements['#cache'] += [
'keys' => [],
];
$elements['#pre_rendered'] = TRUE;
$view->setOffset(12);
$this->assertEquals(12, $view->getOffset());
$this->assertNotContains('offset:12', $view->element['#cache']['keys']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.