
| Current Path : /var/www/html/dataninja.cn/core/modules/views/tests/src/Kernel/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/dataninja.cn/core/modules/views/tests/src/Kernel/ViewsTemplateTest.php |
<?php
namespace Drupal\Tests\views\Kernel;
use Drupal\views\Views;
/**
* Tests the template retrieval of views.
*
* @group views
*
* @see \Drupal\views_test_data\Plugin\views\style\StyleTemplateTest
*/
class ViewsTemplateTest extends ViewsKernelTestBase {
/**
* {@inheritdic}
*/
public static $testViews = ['test_view_display_template'];
/**
* Tests render functionality.
*/
public function testTemplate() {
// Make sure that the rendering just calls the preprocess function once.
$output = Views::getView('test_view_display_template')->preview();
$renderer = $this->container->get('renderer');
// Check that the renderd output uses the correct template file.
$this->assertContains('This module defines its own display template.', (string) $renderer->renderRoot($output));
}
}