Skip to content

Commit 087ee6b

Browse files
committed
Fix test
1 parent 4b174c4 commit 087ee6b

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

features/post-revision.feature

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ Feature: Manage WordPress post revisions
33
Background:
44
Given a WP install
55

6+
# Creating a published post doesn't create an initial revision,
7+
# so we update it twice here and restore the middle version.
8+
# See https://github.com/wp-cli/entity-command/issues/564.
69
Scenario: Restore a post revision
710
When I run `wp post create --post_title='Original Post' --post_content='Original content' --porcelain`
811
Then STDOUT should be a number
@@ -14,10 +17,22 @@ Feature: Manage WordPress post revisions
1417
Success: Updated post {POST_ID}.
1518
"""
1619

17-
When I run `wp post list --post_type=revision --post_parent={POST_ID} --fields=ID,post_title --format=ids`
20+
When I run `wp post list --post_type=revision --post_parent={POST_ID} --format=ids`
1821
Then STDOUT should not be empty
1922
And save STDOUT as {REVISION_ID}
2023

24+
When I run `wp post update {POST_ID} --post_content='Another one'`
25+
Then STDOUT should contain:
26+
"""
27+
Success: Updated post {POST_ID}.
28+
"""
29+
30+
When I run `wp post get {POST_ID} --field=post_content`
31+
Then STDOUT should contain:
32+
"""
33+
Another one
34+
"""
35+
2136
When I run `wp post revision restore {REVISION_ID}`
2237
Then STDOUT should contain:
2338
"""
@@ -27,7 +42,7 @@ Feature: Manage WordPress post revisions
2742
When I run `wp post get {POST_ID} --field=post_content`
2843
Then STDOUT should contain:
2944
"""
30-
Original content
45+
Updated content
3146
"""
3247

3348
Scenario: Restore invalid revision should fail

0 commit comments

Comments
 (0)