Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
37ce9e5c
Commit
37ce9e5c
authored
Sep 05, 2013
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2073875
by nick_schuch: Fixed TourTestBase needs to allow for list elements in the body.
parent
c1c38a9b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
core/modules/tour/lib/Drupal/tour/Tests/TourTest.php
core/modules/tour/lib/Drupal/tour/Tests/TourTest.php
+2
-2
core/modules/tour/lib/Drupal/tour/Tests/TourTestBase.php
core/modules/tour/lib/Drupal/tour/Tests/TourTestBase.php
+1
-1
core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml
...dules/tour/tests/tour_test/config/tour.tour.tour-test.yml
+8
-0
No files found.
core/modules/tour/lib/Drupal/tour/Tests/TourTest.php
View file @
37ce9e5c
...
...
@@ -55,7 +55,7 @@ public function testTourFunctionality() {
// 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 la
st'
,
':classes'
=>
'tip-module-tour-test tip-type-text tip-tour-test-1
odd fir
st'
,
':data_id'
=>
'tour-test-1'
,
':text'
=>
'The first tip'
,
));
...
...
@@ -69,7 +69,7 @@ public function testTourFunctionality() {
$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 la
st'
,
':classes'
=>
'tip-module-tour-test tip-type-text tip-tour-test-1
odd fir
st'
,
':data_id'
=>
'tour-test-1'
,
':href'
=>
url
(
'<front>'
,
array
(
'absolute'
=>
TRUE
)),
':text'
=>
'Drupal'
,
...
...
core/modules/tour/lib/Drupal/tour/Tests/TourTestBase.php
View file @
37ce9e5c
...
...
@@ -38,7 +38,7 @@ public function assertTourTips($tips = array()) {
// 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'
];
...
...
core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml
View file @
37ce9e5c
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment