ViewsThemeIntegrationTest.php in Zircon Profile 8.0
File
core/modules/views/src/Tests/ViewsThemeIntegrationTest.php
View source
<?php
namespace Drupal\views\Tests;
class ViewsThemeIntegrationTest extends ViewTestBase {
public static $testViews = array(
'test_page_display',
);
public static $modules = array(
'views',
'theme_test',
);
protected function setUp() {
parent::setUp();
$this
->enableViewsTestModule();
}
public function testThemedViewPage() {
\Drupal::service('theme_handler')
->install(array(
'test_basetheme',
'test_subtheme',
));
$this
->config('system.theme')
->set('default', 'test_basetheme')
->save();
$this
->assertEqual($this
->config('system.theme')
->get('default'), 'test_basetheme');
$this
->drupalGet('test_page_display_200');
$this
->assertRaw("test_basetheme_views_pre_render", "Views title changed by test_basetheme.test_basetheme_views_pre_render");
$this
->assertRaw("test_basetheme_views_post_render", "Views title changed by test_basetheme.test_basetheme_views_post_render");
$this
->config('system.theme')
->set('default', 'test_subtheme')
->save();
$this
->assertEqual($this
->config('system.theme')
->get('default'), 'test_subtheme');
$this
->drupalGet('test_page_display_200');
$this
->assertRaw("test_subtheme_views_pre_render", "Views title changed by test_subtheme.test_subtheme_views_pre_render");
$this
->assertRaw("test_subtheme_views_post_render", "Views title changed by test_subtheme.test_subtheme_views_post_render");
$this
->assertRaw("test_basetheme_views_pre_render", "Views title changed by test_basetheme.test_basetheme_views_pre_render");
$this
->assertRaw("test_basetheme_views_post_render", "Views title changed by test_basetheme.test_basetheme_views_post_render");
$this
->assertRaw('<em class="placeholder">' . count($this
->dataSet()) . '</em> items found.', 'Views group title added by test_subtheme.test_subtheme_views_post_render');
}
}