Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions features/comment.feature
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ Feature: Manage WordPress comments
When I run `wp comment url 1 {COMMENT_ID}`
Then STDOUT should be:
"""
http://example.com/?p=1#comment-1
http://example.com/?p=1#comment-{COMMENT_ID}
https://example.com/?p=1#comment-1
https://example.com/?p=1#comment-{COMMENT_ID}
"""

When I run `wp comment url {COMMENT_ID} 1`
Then STDOUT should be:
"""
http://example.com/?p=1#comment-{COMMENT_ID}
http://example.com/?p=1#comment-1
https://example.com/?p=1#comment-{COMMENT_ID}
https://example.com/?p=1#comment-1
"""

Scenario: Count comments
Expand Down
6 changes: 3 additions & 3 deletions features/menu-item.feature
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ Feature: Manage WordPress menu items
When I run `wp menu create "Grandparent Test"`
Then STDOUT should not be empty

When I run `wp menu item add-custom grandparent-test Grandparent http://example.com/grandparent --porcelain`
When I run `wp menu item add-custom grandparent-test Grandparent https://example.com/grandparent --porcelain`
Then save STDOUT as {GRANDPARENT_ID}

When I run `wp menu item add-custom grandparent-test Parent http://example.com/parent --porcelain --parent-id={GRANDPARENT_ID}`
When I run `wp menu item add-custom grandparent-test Parent https://example.com/parent --porcelain --parent-id={GRANDPARENT_ID}`
Then save STDOUT as {PARENT_ID}

When I run `wp menu item add-custom grandparent-test Child http://example.com/child --porcelain --parent-id={PARENT_ID}`
When I run `wp menu item add-custom grandparent-test Child https://example.com/child --porcelain --parent-id={PARENT_ID}`
Then save STDOUT as {CHILD_ID}

When I run `wp menu item list grandparent-test --fields=title,db_id,menu_item_parent`
Expand Down
2 changes: 1 addition & 1 deletion features/option.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Feature: Manage WordPress options
When I run `wp option list`
Then STDOUT should contain:
"""
home http://example.com
home https://example.com
"""

When I run `wp option add auto_opt --autoload=no 'bar'`
Expand Down
4 changes: 2 additions & 2 deletions features/post.feature
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ Feature: Manage WordPress posts
When I run `wp post url 1 {POST_ID}`
Then STDOUT should be:
"""
http://example.com/?p=1
http://example.com/?p={POST_ID}
https://example.com/?p=1
https://example.com/?p={POST_ID}
"""

Scenario: Update a post from file or STDIN
Expand Down
6 changes: 3 additions & 3 deletions features/site-empty.feature
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Feature: Empty a WordPress site of its data
When I run `wp site empty --yes`
Then STDOUT should be:
"""
Success: The site at 'http://example.com' was emptied.
Success: The site at 'https://example.com' was emptied.
"""
And the wp-content/uploads/large-image.jpg file should exist

Expand Down Expand Up @@ -119,9 +119,9 @@ Feature: Empty a WordPress site of its data
Then STDOUT should be empty

When I run `wp --url=example.com/foo site empty --uploads --yes`
Then STDOUT should be:
Then STDOUT should contain:
"""
Success: The site at 'http://example.com/foo' was emptied.
://example.com/foo' was emptied.
"""
And the wp-content/uploads/sites/2/large-image.jpg file should not exist

Expand Down
52 changes: 32 additions & 20 deletions features/site.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Feature: Manage sites in a multisite installation
When I run `wp site list --fields=blog_id,url`
Then STDOUT should be a table containing rows:
| blog_id | url |
| 1 | http://example.com/ |
| 1 | https://example.com/ |
| 2 | http://first.example.com/ |

When I run `wp site list --format=ids`
Expand All @@ -44,18 +44,20 @@ Feature: Manage sites in a multisite installation
When I run `wp site create --slug=first --porcelain`
Then STDOUT should be a number
And save STDOUT as {SITE_ID}
And I run `wp site list --site__in={SITE_ID} --field=url | sed -e's,^\(.*\)://.*,\1,g'`
And save STDOUT as {SCHEME}

When I run `wp site list --fields=blog_id,url`
Then STDOUT should be a table containing rows:
| blog_id | url |
| 1 | http://example.com/ |
| 2 | http://example.com/first/ |
| blog_id | url |
| 1 | https://example.com/ |
| 2 | {SCHEME}://example.com/first/ |

When I run `wp site list --field=url`
Then STDOUT should be:
"""
http://example.com/
http://example.com/first/
https://example.com/
{SCHEME}://example.com/first/
"""

When I try `wp site delete 1`
Expand All @@ -69,7 +71,7 @@ Feature: Manage sites in a multisite installation
When I run `wp site delete {SITE_ID} --yes`
Then STDOUT should be:
"""
Success: The site at 'http://example.com/first/' was deleted.
Success: The site at '{SCHEME}://example.com/first/' was deleted.
"""

When I try the previous command again
Expand All @@ -81,32 +83,38 @@ Feature: Manage sites in a multisite installation
When I run `wp site create --slug=first --porcelain`
Then STDOUT should be a number
And save STDOUT as {SITE_ID}
And I run `wp site list --site__in={SITE_ID} --field=url | sed -e's,^\(.*\)://.*,\1,g'`
And save STDOUT as {SCHEME}

When I run `wp site list --fields=blog_id,url`
Then STDOUT should be a table containing rows:
| blog_id | url |
| 1 | http://example.com/ |
| 2 | http://example.com/first/ |
| blog_id | url |
| 1 | https://example.com/ |
| 2 | {SCHEME}://example.com/first/ |

When I run `wp site list --field=url --blog_id=2`
Then STDOUT should be:
"""
http://example.com/first/
{SCHEME}://example.com/first/
"""

Scenario: Delete a site by slug
Given a WP multisite install

When I run `wp site create --slug=first`
Then STDOUT should be:
Then STDOUT should contain:
"""
Success: Site 2 created: http
"""
Success: Site 2 created: http://example.com/first/
And STDOUT should contain:
"""
://example.com/first/
"""

When I run `wp site delete --slug=first --yes`
Then STDOUT should be:
Then STDOUT should contain:
"""
Success: The site at 'http://example.com/first/' was deleted.
://example.com/first/' was deleted.
"""

When I try the previous command again
Expand All @@ -118,22 +126,26 @@ Feature: Manage sites in a multisite installation
When I run `wp site create --slug=first --porcelain`
Then STDOUT should be a number
And save STDOUT as {SITE_ID}
And I run `wp site list --site__in={SITE_ID} --field=url | sed -e's,^\(.*\)://.*,\1,g'`
And save STDOUT as {SCHEME}

When I run `wp site url {SITE_ID}`
Then STDOUT should be:
"""
http://example.com/first/
{SCHEME}://example.com/first/
"""

When I run `wp site create --slug=second --porcelain`
Then STDOUT should be a number
And save STDOUT as {SECOND_ID}
And I run `wp site list --site__in={SECOND_ID} --field=url | sed -e's,^\(.*\)://.*,\1,g'`
And save STDOUT as {SECOND_SCHEME}

When I run `wp site url {SECOND_ID} {SITE_ID}`
Then STDOUT should be:
"""
http://example.com/second/
http://example.com/first/
{SECOND_SCHEME}://example.com/second/
{SCHEME}://example.com/first/
"""

Scenario: Archive/unarchive a site
Expand Down Expand Up @@ -413,9 +425,9 @@ Feature: Manage sites in a multisite installation
"""

When I run `wp --url=example.com/first option get home`
Then STDOUT should be:
Then STDOUT should contain:
"""
http://example.com/first
://example.com/first
"""

Scenario: Create site with title containing slash
Expand Down
10 changes: 5 additions & 5 deletions features/term.feature
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,21 @@ Feature: Manage WordPress terms
When I run `wp term url category {TERM_ID}`
Then STDOUT should be:
"""
http://example.com/?cat=2
https://example.com/?cat=2
"""

When I run `wp term url category {TERM_ID} {SECOND_TERM_ID}`
Then STDOUT should be:
"""
http://example.com/?cat=2
http://example.com/?cat=3
https://example.com/?cat=2
https://example.com/?cat=3
"""

When I run `wp term url category {SECOND_TERM_ID} {TERM_ID}`
Then STDOUT should be:
"""
http://example.com/?cat=3
http://example.com/?cat=2
https://example.com/?cat=3
https://example.com/?cat=2
"""

Scenario: Make sure WordPress receives the slashed data it expects
Expand Down
4 changes: 2 additions & 2 deletions features/user.feature
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,8 @@ Feature: Manage WordPress users
When I run `wp user list --include=1,2 --field=url`
Then STDOUT should be:
"""
http://example.com/?author=1
http://example.com/?author=2
https://example.com/?author=1
https://example.com/?author=2
"""

Scenario: Get user with email as login
Expand Down