File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -438,3 +438,39 @@ Feature: Manage WordPress posts
438438 """
439439 0
440440 """
441+
442+ Scenario : Publishing a post and setting a date fails if the edit_date flag is not passed.
443+ Given a WP install
444+
445+ When I run `wp post create --post_title='test' --porcelain`
446+ Then save STDOUT as {POST_ID}
447+
448+ When I run `wp post update {POST_ID} --post_date='2005-01-24T09:52:00.000Z' --post_status='publish' `
449+ Then STDOUT should contain:
450+ """
451+ Success:
452+ """
453+
454+ When I run `wp post get {POST_ID} --field=post_date`
455+ Then STDOUT should not contain:
456+ """
457+ 2005-01-24 09:52:00
458+ """
459+
460+ Scenario : Publishing a post and setting a date succeeds if the edit_date flag is passed.
461+ Given a WP install
462+
463+ When I run `wp post create --post_title='test' --porcelain`
464+ Then save STDOUT as {POST_ID}
465+
466+ When I run `wp post update {POST_ID} --post_date='2005-01-24T09:52:00.000Z' --post_status='publish' --edit_date=1`
467+ Then STDOUT should contain:
468+ """
469+ Success:
470+ """
471+
472+ When I run `wp post get {POST_ID} --field=post_date`
473+ Then STDOUT should contain:
474+ """
475+ 2005-01-24 09:52:00
476+ """
You can’t perform that action at this time.
0 commit comments