diff -u b/core/modules/views/lib/Drupal/views/Tests/ViewsThemeIntegrationTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewsThemeIntegrationTest.php --- b/core/modules/views/lib/Drupal/views/Tests/ViewsThemeIntegrationTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewsThemeIntegrationTest.php @@ -7,14 +7,20 @@ namespace Drupal\views\Tests; -use Drupal\simpletest\WebTestBase; - /** * As views uses a lot of theme related functionality we need to test these too. * * We test against test_basetheme and test_subtheme provided by theme_test */ -class ViewsThemeIntegrationTest extends WebTestBase { +class ViewsThemeIntegrationTest extends ViewTestBase { + + /** + * Views used by this test. + * + * @var array + */ + public static $testViews = array('test_page_display'); + /** * Used by WebTestBase::setup() @@ -25,7 +31,7 @@ * * @see \Drupal\simpletest\WebTestBase::setup() */ - public static $modules = array('views', 'node', 'user', 'theme_test'); + public static $modules = array('views', 'theme_test'); /** * {@inheritdoc} @@ -34,7 +40,7 @@ return array( 'name' => 'Views theme integration test', 'description' => 'Tests the Views theme integration.', - 'group' => 'Views theming', + 'group' => 'Views', ); } @@ -43,33 +49,15 @@ */ protected function setUp() { parent::setUp(); + + $this->enableViewsTestModule(); } /** - * Tests for exceptions. + * Tests for exceptions and successful execution of hook_views_pre_render() + * and hook_views_post_render() in theme and subtheme. */ - public function testNodesPage() { - - $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()); + public function testThemedViewPage() { \Drupal::service('theme_handler')->enable(array('test_basetheme', 'test_subtheme')); @@ -80,8 +68,7 @@ $this->assertEqual(\Drupal::config('system.theme')->get('default'), 'test_basetheme'); // Make sure a views rendered page is touched. - $this->drupalGet('node'); - $this->assertRaw($values['title'], "Title found"); + $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"); @@ -94,8 +81,7 @@ $this->assertEqual(\Drupal::config('system.theme')->get('default'), 'test_subtheme'); // Make sure a views rendered page is touched. - $this->drupalGet('node'); - $this->assertRaw($values['title'], "Title found"); + $this->drupalGet('test_page_display_200'); $this->assertRaw("test_subtheme_views_pre_render", "Views title changed by test_usetheme.test_subtheme_views_pre_render"); $this->assertRaw("test_subtheme_views_post_render", "Views title changed by test_usetheme.test_subtheme_views_post_render");