summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2013-07-24 22:34:13 +0200
committerAlex Pott2013-07-24 22:56:59 +0200
commit251499736bace5e4fd8dab735645aee0babc0da0 (patch)
treea05438bb2d6b68c93be0dba852aed4d08389d125
parent41f6e35eb758c3f363a03f3174bc575afe3d8207 (diff)
Issue #1875344 by aaronott, damiankloip: Add back removed test coverage in Views' OverrideDisplaysTest.
-rw-r--r--core/modules/views_ui/lib/Drupal/views_ui/Tests/OverrideDisplaysTest.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/OverrideDisplaysTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/OverrideDisplaysTest.php
index 69f2730..38b3d36 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/OverrideDisplaysTest.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/OverrideDisplaysTest.php
@@ -96,7 +96,6 @@ class OverrideDisplaysTest extends UITestBase {
$view['block[title]'] = $this->randomName(16);
$this->drupalPost('admin/structure/views/add', $view, t('Save and edit'));
-
// Add a node that will appear in the view, so that the block will actually
// be displayed.
$this->drupalCreateNode();
@@ -116,8 +115,18 @@ class OverrideDisplaysTest extends UITestBase {
$this->drupalGet('admin/structure/block/list/block_plugin_ui:' . config('system.theme')->get('default') . '/add');
$this->assertText('View: ' . $view['label']);
- // Place the block.
- $this->drupalPlaceBlock("views_block:{$view['id']}-block_1");
+ // Put the block into the first sidebar region, and make sure it will not
+ // display on the view's page display (since we will be searching for the
+ // presence/absence of the view's title in both the page and the block).
+ $this->drupalPlaceBlock("views_block:{$view['id']}-block_1", array(
+ 'visibility' => array(
+ 'path' => array(
+ 'visibility' => BLOCK_VISIBILITY_NOTLISTED,
+ 'pages' => $view['page[path]'],
+ ),
+ ),
+ ));
+
$this->drupalGet('');
$this->assertText($view['block[title]']);
$this->assertNoText($view['page[title]']);
@@ -132,15 +141,16 @@ class OverrideDisplaysTest extends UITestBase {
$this->assertResponse(200);
$this->assertText($new_default_title);
$this->assertNoText($view['page[title]']);
+ $this->assertNoText($view['block[title]']);
$this->drupalGet($view['page[feed_properties][path]']);
$this->assertResponse(200);
$this->assertText($new_default_title);
$this->assertNoText($view['page[title]']);
$this->assertNoText($view['block[title]']);
$this->drupalGet('');
- $this->assertText($view['block[title]']);
$this->assertNoText($new_default_title);
$this->assertNoText($view['page[title]']);
+ $this->assertText($view['block[title]']);
// Edit the block and change the title. This should automatically change
// the block title only, and leave the defaults alone.