diff --git a/core/modules/system/tests/themes/test_subtheme/css/sub-add.css b/core/modules/system/tests/themes/test_subtheme/css/sub-add.css new file mode 100644 index 0000000..a1dad90 --- /dev/null +++ b/core/modules/system/tests/themes/test_subtheme/css/sub-add.css @@ -0,0 +1,5 @@ +/* Thanks to http://jonathandean.com/2013/01/showing-the-current-breakpoint-name-when-testing-responsive-designs-using-only-css/ */ +body:after { + content: 'Showing test_subtheme'; + font-weight: bold; +} diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewsThemeIntegrationTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewsThemeIntegrationTest.php new file mode 100644 index 0000000..c4caf6f --- /dev/null +++ b/core/modules/views/lib/Drupal/views/Tests/ViewsThemeIntegrationTest.php @@ -0,0 +1,93 @@ + 'Views theme integration test', + 'description' => 'Tests the Views theme integration.', + 'group' => 'Views theming', + ); + } + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + } + + /** + * Tests for exceptions. + */ + public function testFrontPage() { + + $account = $this->drupalCreateUser(array()); + $this->drupalLogin($account); + + // Create article for view on the frontpage. + $type_values = array( + 'type' => 'article', + 'name' => 'Basic article', + 'published' => TRUE, + 'promote' => TRUE, + ); + $this->drupalCreateContentType($type_values); + + $values['type'] = 'article'; + $values['title'] = $this->randomName(); + $values['promote'] = TRUE; + $values['status'] = TRUE; + $values['created'] = REQUEST_TIME; + + $node = $this->drupalCreateNode($values); + $this->drupalGet('node/' . $node->id()); + + \Drupal::service('theme_handler')->enable(array('test_basetheme', 'test_subtheme')); + + // Make base theme default first + \Drupal::config('system.theme') + ->set('default', 'test_basetheme') + ->save(); + $this->assertEqual(\Drupal::config('system.theme')->get('default'), 'test_basetheme'); + + // Views kicks in + $this->drupalGet('node'); + $this->assertRaw($values['title'], "Title found"); + + // Make base theme default first + \Drupal::config('system.theme') + ->set('default', 'test_subtheme') + ->save(); + $this->assertEqual(\Drupal::config('system.theme')->get('default'), 'test_subtheme'); + + // Views kicks in + $this->drupalGet('node'); + $this->assertRaw($values['title'], "Title found"); + } + +}