comparison core/modules/views/tests/src/Kernel/ViewRenderTest.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
1 <?php
2
3 namespace Drupal\Tests\views\Kernel;
4
5 use Drupal\views\Views;
6
7 /**
8 * Tests general rendering of a view.
9 *
10 * @group views
11 */
12 class ViewRenderTest extends ViewsKernelTestBase {
13
14 /**
15 * {@inheritdoc}
16 */
17 public static $testViews = ['test_view_render'];
18
19 /**
20 * Tests render functionality.
21 */
22 public function testRender() {
23 $state = $this->container->get('state');
24 $state->set('views_render.test', 0);
25
26 // Make sure that the rendering just calls the preprocess function once.
27 $view = Views::getView('test_view_render');
28 $output = $view->preview();
29 $this->container->get('renderer')->renderRoot($output);
30
31 $this->assertEquals(1, $state->get('views_render.test'));
32 }
33
34 }