public function ViewRenderTest::testRender

Tests render functionality.

File

drupal/core/modules/views/lib/Drupal/views/Tests/ViewRenderTest.php, line 39
Contains \Drupal\views\Tests\ViewRenderTest.

Class

ViewRenderTest

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_get_view('test_view_render');
  $output = $view
    ->preview();
  drupal_render($output);
  $this
    ->assertEqual(\Drupal::state()
    ->get('views_render.test'), 1);
}