You are here

public function ViewRenderTest::testRender in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/ViewRenderTest.php \Drupal\views\Tests\ViewRenderTest::testRender()

Tests render functionality.

File

core/modules/views/src/Tests/ViewRenderTest.php, line 36
Contains \Drupal\views\Tests\ViewRenderTest.

Class

ViewRenderTest
Tests general rendering of a view.

Namespace

Drupal\views\Tests

Code

public function testRender() {
  \Drupal::state()
    ->set('views_render.test', 0);

  // Make sure that the rendering just calls the preprocess function once.
  $view = Views::getView('test_view_render');
  $output = $view
    ->preview();
  $this->container
    ->get('renderer')
    ->renderRoot($output);
  $this
    ->assertEqual(\Drupal::state()
    ->get('views_render.test'), 1);
}