summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2013-09-05 00:38:48 (GMT)
committer Alex Pott2013-09-05 00:38:48 (GMT)
commit37ce9e5c014e667302172cdee3f9ffbe03f1c91d (patch)
tree0535d7234a89d7ef0f696ccd048ba3be4185f914
parentc1c38a9b086c3ce61e228546c57dde2b05c58f6d (diff)
Issue #2073875 by nick_schuch: Fixed TourTestBase needs to allow for list elements in the body.
-rw-r--r--core/modules/tour/lib/Drupal/tour/Tests/TourTest.php4
-rw-r--r--core/modules/tour/lib/Drupal/tour/Tests/TourTestBase.php2
-rw-r--r--core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml8
3 files changed, 11 insertions, 3 deletions
diff --git a/core/modules/tour/lib/Drupal/tour/Tests/TourTest.php b/core/modules/tour/lib/Drupal/tour/Tests/TourTest.php
index f7d0fe1..fcae023 100644
--- a/core/modules/tour/lib/Drupal/tour/Tests/TourTest.php
+++ b/core/modules/tour/lib/Drupal/tour/Tests/TourTest.php
@@ -55,7 +55,7 @@ class TourTest extends TourTestBasic {
// Navigate to tour-test-1 and verify the tour_test_1 tip is found with appropriate classes.
$this->drupalGet('tour-test-1');
$elements = $this->xpath('//li[@data-id=:data_id and @class=:classes and ./h2[contains(., :text)]]', array(
- ':classes' => 'tip-module-tour-test tip-type-text tip-tour-test-1 even last',
+ ':classes' => 'tip-module-tour-test tip-type-text tip-tour-test-1 odd first',
':data_id' => 'tour-test-1',
':text' => 'The first tip',
));
@@ -69,7 +69,7 @@ class TourTest extends TourTestBasic {
$this->assertTourTips();
$elements = $this->xpath('//li[@data-id=:data_id and @class=:classes and ./p//a[@href=:href and contains(., :text)]]', array(
- ':classes' => 'tip-module-tour-test tip-type-text tip-tour-test-1 even last',
+ ':classes' => 'tip-module-tour-test tip-type-text tip-tour-test-1 odd first',
':data_id' => 'tour-test-1',
':href' => url('<front>', array('absolute' => TRUE)),
':text' => 'Drupal',
diff --git a/core/modules/tour/lib/Drupal/tour/Tests/TourTestBase.php b/core/modules/tour/lib/Drupal/tour/Tests/TourTestBase.php
index ae22b30..cf98e07 100644
--- a/core/modules/tour/lib/Drupal/tour/Tests/TourTestBase.php
+++ b/core/modules/tour/lib/Drupal/tour/Tests/TourTestBase.php
@@ -38,7 +38,7 @@ class TourTestBase extends WebTestBase {
// Get the rendered tips and their data-id and data-class attributes.
if (empty($tips)) {
// Tips are rendered as <li> elements inside <ol id="tour">.
- $rendered_tips = $this->xpath('//ol[@id = "tour"]//li');
+ $rendered_tips = $this->xpath('//ol[@id = "tour"]//li[starts-with(@class, "tip")]');
foreach ($rendered_tips as $rendered_tip) {
$attributes = (array) $rendered_tip->attributes();
$tips[] = $attributes['@attributes'];
diff --git a/core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml b/core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml
index 9d389ed..8da1586 100644
--- a/core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml
+++ b/core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml
@@ -21,3 +21,11 @@ tips:
weight: "1"
attributes:
data-id: tour-test-3
+ tour-test-6:
+ id: tour-test-6
+ plugin: text
+ label: Im a list
+ body: <p>Im all these things:</p><ul><li>Modal</li><li>Awesome</li></ul>
+ weight: "6"
+ attributes:
+ data-id: tour-test-3