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