File tree Expand file tree Collapse file tree 2 files changed +25
-13
lines changed Expand file tree Collapse file tree 2 files changed +25
-13
lines changed Original file line number Diff line number Diff line change
1
+ Feature : Get the post ID for a given URL
2
+
3
+ Background :
4
+ Given a WP install
5
+
6
+ @daniel
7
+ Scenario : Get the post ID for a given URL
8
+ When I run `wp post get 1 --field=url`
9
+ Then STDOUT should be:
10
+ """
11
+ https://example.com/?p=1
12
+ """
13
+ And save STDOUT as {POST_URL}
14
+
15
+ When I run `wp post url-to-id {POST_URL}`
16
+ Then STDOUT should contain:
17
+ """
18
+ 1
19
+ """
20
+
21
+ When I try `wp post url-to-id 'https://example.com/?p=404' `
22
+ Then STDERR should contain:
23
+ """
24
+ Could not get post with url https://example.com/?p=404.
25
+ """
Original file line number Diff line number Diff line change @@ -259,19 +259,6 @@ Feature: Manage WordPress posts
259
259
"""
260
260
https://example.com/?p=1
261
261
"""
262
- And save STDOUT as {POST_URL}
263
-
264
- When I run `wp post url-to-id {POST_URL}`
265
- Then STDOUT should contain:
266
- """
267
- 1
268
- """
269
-
270
- When I try `wp post url-to-id 'https://example.com/?p=404' `
271
- Then STDERR should contain:
272
- """
273
- Could not get post with url https://example.com/?p=404.
274
- """
275
262
276
263
Scenario : Update a post from file or STDIN
277
264
Given a content.html file:
You can’t perform that action at this time.
0 commit comments