Mercurial > hg > isophonics-drupal-site
comparison core/modules/views/tests/src/Kernel/ViewsTemplateTest.php @ 18:af1871eacc83
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:33:08 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
17:129ea1e6d783 | 18:af1871eacc83 |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\Tests\views\Kernel; | |
4 | |
5 use Drupal\views\Views; | |
6 | |
7 /** | |
8 * Tests the template retrieval of views. | |
9 * | |
10 * @group views | |
11 * | |
12 * @see \Drupal\views_test_data\Plugin\views\style\StyleTemplateTest | |
13 */ | |
14 class ViewsTemplateTest extends ViewsKernelTestBase { | |
15 | |
16 /** | |
17 * {@inheritdic} | |
18 */ | |
19 public static $testViews = ['test_view_display_template']; | |
20 | |
21 /** | |
22 * Tests render functionality. | |
23 */ | |
24 public function testTemplate() { | |
25 // Make sure that the rendering just calls the preprocess function once. | |
26 $output = Views::getView('test_view_display_template')->preview(); | |
27 $renderer = $this->container->get('renderer'); | |
28 | |
29 // Check that the renderd output uses the correct template file. | |
30 $this->assertContains('This module defines its own display template.', (string) $renderer->renderRoot($output)); | |
31 } | |
32 | |
33 } |