File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,30 @@ Feature: Manage term custom fields
2323 Success: Migrated the term 'apple' from taxonomy 'category' to taxonomy 'post_tag' for 1 post
2424 """
2525
26+ @require-wp-4.4
27+ Scenario : Migrate a term that exist with id
28+ Given a WP install
29+
30+ When I run `wp term create category apple --porcelain`
31+ Then STDOUT should be a number
32+ And save STDOUT as {TERM_ID}
33+
34+ When I run `wp post create --post_title='Test post' --porcelain`
35+ Then STDOUT should be a number
36+ And save STDOUT as {POST_ID}
37+
38+ When I run `wp post term set {POST_ID} category {TERM_ID}`
39+ Then STDOUT should not be empty
40+
41+ When I run `wp term migrate {TERM_ID} --by=slug --from=category --to=post_tag`
42+ Then STDOUT should be:
43+ """
44+ Term '{TERM_ID}' assigned to post 4.
45+ Term '{TERM_ID}' migrated!
46+ Old instance of term '{TERM_ID}' removed from its original taxonomy.
47+ Success: Migrated the term '{TERM_ID}' from taxonomy 'category' to taxonomy 'post_tag' for 1 post
48+ """
49+
2650 Scenario : Migrate a term in multiple posts
2751 Given a WP install
2852
@@ -57,7 +81,7 @@ Feature: Manage term custom fields
5781 Scenario : Migrate a term that not exist
5882 Given a WP install
5983
60- When I run `wp term migrate peach --by=slug --from=category --to=post_tag`
84+ When I try `wp term migrate peach --by=slug --from=category --to=post_tag`
6185 Then STDERR should be:
6286 """
6387 Error: Taxonomy term `peach` for taxonomy `category` doesn't exist.
You can’t perform that action at this time.
0 commit comments