Mercurial > hg > isophonics-drupal-site
comparison core/modules/views/tests/src/Functional/ViewRenderTest.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\Tests\views\Functional; | |
4 | |
5 use Drupal\views\Views; | |
6 | |
7 /** | |
8 * Tests general rendering of a view. | |
9 * | |
10 * @group views | |
11 */ | |
12 class ViewRenderTest extends ViewTestBase { | |
13 | |
14 /** | |
15 * Views used by this test. | |
16 * | |
17 * @var array | |
18 */ | |
19 public static $testViews = ['test_view_render']; | |
20 | |
21 protected function setUp($import_test_views = TRUE) { | |
22 parent::setUp($import_test_views); | |
23 | |
24 $this->enableViewsTestModule(); | |
25 } | |
26 | |
27 | |
28 /** | |
29 * Tests render functionality. | |
30 */ | |
31 public function testRender() { | |
32 \Drupal::state()->set('views_render.test', 0); | |
33 | |
34 // Make sure that the rendering just calls the preprocess function once. | |
35 $view = Views::getView('test_view_render'); | |
36 $output = $view->preview(); | |
37 $this->container->get('renderer')->renderRoot($output); | |
38 | |
39 $this->assertEqual(\Drupal::state()->get('views_render.test'), 1); | |
40 } | |
41 | |
42 } |