@@ -365,18 +365,38 @@ Feature: Manage WordPress posts
365365 | Publish post | publish -post | publish |
366366 | Sample Page | sample -page | publish |
367367
368- When I run `wp post create --post_title='old post' --post_date='2023-01-24T09:52:00.000Z' `
369- And I run `wp post create --post_title='new post' --post_date='2025-01-24T09:52:00.000Z' `
370- And I run `wp post list --field=post_title --date_query='{"before":{"year":"2024"}}' `
371- Then STDOUT should contain:
368+ Scenario : List posts with date query
369+ When I run `wp post create --post_title='old post' --post_date='2023-01-24T09:52:00.000Z' `
370+ And I run `wp post create --post_title='new post' --post_date='2025-01-24T09:52:00.000Z' `
371+ And I run `wp post list --field=post_title --date_query='{"before":{"year":"2024"}}' `
372+ Then STDOUT should contain:
372373 """
373374 old post
374375 """
375- And STDOUT should not contain:
376- """
376+ And STDOUT should not contain:
377+ """
377378 new post
378379 """
379380
381+ Scenario : List posts with tax query
382+ When I run `wp term create category "First Category" --porcelain`
383+ And save STDOUT as {TERM_ID}
384+ And I run `wp term create category "Second Category" --porcelain`
385+ And save STDOUT as {SECOND_TERM_ID}
386+
387+ When I run `wp post create --post_title='post-1' --post_category="First Category" `
388+ When I run `wp post create --post_title='post-2' --post_category="Second Category" `
389+ And I run `wp post create --post_title='new post' --post_date='2025-01-24T09:52:00.000Z' `
390+ And I run `wp post list --field=post_title --tax_query='[{"taxonomy":"category","field":"slug","terms":"first-category"}]' `
391+ Then STDOUT should contain:
392+ """
393+ post-1
394+ """
395+ And STDOUT should not contain:
396+ """
397+ post-2
398+ """
399+
380400 Scenario : Update categories on a post
381401 When I run `wp term create category "Test Category" --porcelain`
382402 Then save STDOUT as {TERM_ID}
0 commit comments