You are here

public function ViewExecutableTest::testSetCurrentPageBeforePreRender in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/tests/src/Unit/ViewExecutableTest.php \Drupal\Tests\views\Unit\ViewExecutableTest::testSetCurrentPageBeforePreRender()

@covers ::setCurrentPage @covers ::getCurrentPage

File

core/modules/views/tests/src/Unit/ViewExecutableTest.php, line 540
Contains \Drupal\Tests\views\Unit\ViewExecutableTest.

Class

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

Namespace

Drupal\Tests\views\Unit

Code

public function testSetCurrentPageBeforePreRender() {

  /** @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();
  $view
    ->setCurrentPage(12);
  $this
    ->assertEquals(12, $view
    ->getCurrentPage());
  $this
    ->assertContains('page:12', $view->element['#cache']['keys']);
}