Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
migrate_plus
Commits
62ea7730
Commit
62ea7730
authored
Dec 09, 2020
by
benjifisher
Browse files
92: Add more test cases
- anchor to the document root - select based on inner text - select items with sub-lists
parent
549c9497
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/src/Unit/process/DomRemoveTest.php
View file @
62ea7730
...
...
@@ -49,6 +49,13 @@ class DomRemoveTest extends MigrateProcessTestCase {
// The fourth match is Item 3.1.
'<ul><li>Item 4</li><li>Item 5</li></ul>'
,
],
'top-level li, limit 4'
=>
[
$input_string
,
// Both Html::load() and the dom process plugin wrap HTML snippets in
// <html> and <body> tags.
[
'selector'
=>
'/html/body/ul/li'
,
'limit'
=>
4
],
'<ul><li>Item 5</li></ul>'
,
],
'nested li, no limit'
=>
[
$input_string
,
[
'selector'
=>
'//li//li'
],
...
...
@@ -59,6 +66,16 @@ class DomRemoveTest extends MigrateProcessTestCase {
[
'selector'
=>
'//li//li'
,
'limit'
=>
1
],
'<ul><li>Item 1</li><li>Item 2</li><li><ul><li>Item 3.2</li></ul></li><li>Item 4</li><li>Item 5</li></ul>'
,
],
'specific item'
=>
[
$input_string
,
[
'selector'
=>
'//li[text() = "Item 3.1"]'
],
'<ul><li>Item 1</li><li>Item 2</li><li><ul><li>Item 3.2</li></ul></li><li>Item 4</li><li>Item 5</li></ul>'
,
],
'all items with sub-lists'
=>
[
$input_string
,
[
'selector'
=>
'//li[./ul]'
],
'<ul><li>Item 1</li><li>Item 2</li><li>Item 4</li><li>Item 5</li></ul>'
,
],
];
return
$cases
;
...
...
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