Skip to content

Commit 070fe88

Browse files
committed
Fix Gherkin lint issues
1 parent c388578 commit 070fe88

File tree

3 files changed

+114
-114
lines changed

3 files changed

+114
-114
lines changed

features/http-mocking.feature

Lines changed: 101 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -2,118 +2,118 @@ Feature: HTTP request mocking
22

33
Scenario: Mock HTTP request in WP-CLI
44
Given that HTTP requests to https://api.github.com/repos/wp-cli/wp-cli/releases?per_page=100 will respond with:
5-
"""
6-
HTTP/1.1 200
7-
Content-Type: application/json
5+
"""
6+
HTTP/1.1 200
7+
Content-Type: application/json
88
9-
[
10-
{
11-
"url": "https://api.github.com/repos/wp-cli/wp-cli/releases/169243978",
12-
"assets_url": "https://api.github.com/repos/wp-cli/wp-cli/releases/169243978/assets",
13-
"upload_url": "https://uploads.github.com/repos/wp-cli/wp-cli/releases/169243978/assets{?name,label}",
14-
"html_url": "https://github.com/wp-cli/wp-cli/releases/tag/v999.9.9",
15-
"id": 169243978,
16-
"author": {
17-
"login": "schlessera",
18-
"id": 83631,
19-
"node_id": "MDQ6VXNlcjgzNjMx",
20-
"avatar_url": "https://avatars.githubusercontent.com/u/83631?v=4",
21-
"gravatar_id": "",
22-
"url": "https://api.github.com/users/schlessera",
23-
"html_url": "https://github.com/schlessera",
24-
"followers_url": "https://api.github.com/users/schlessera/followers",
25-
"following_url": "https://api.github.com/users/schlessera/following{/other_user}",
26-
"gists_url": "https://api.github.com/users/schlessera/gists{/gist_id}",
27-
"starred_url": "https://api.github.com/users/schlessera/starred{/owner}{/repo}",
28-
"subscriptions_url": "https://api.github.com/users/schlessera/subscriptions",
29-
"organizations_url": "https://api.github.com/users/schlessera/orgs",
30-
"repos_url": "https://api.github.com/users/schlessera/repos",
31-
"events_url": "https://api.github.com/users/schlessera/events{/privacy}",
32-
"received_events_url": "https://api.github.com/users/schlessera/received_events",
33-
"type": "User",
34-
"user_view_type": "public",
35-
"site_admin": false
36-
},
37-
"node_id": "RE_kwDOACQFs84KFnVK",
38-
"tag_name": "v999.9.9",
39-
"target_commitish": "main",
40-
"name": "Version 999.9.9",
41-
"draft": false,
42-
"prerelease": false,
43-
"created_at": "2024-08-08T03:04:55Z",
44-
"published_at": "2024-08-08T03:51:13Z",
45-
"assets": [
46-
{
47-
"url": "https://api.github.com/repos/wp-cli/wp-cli/releases/assets/184590231",
48-
"id": 184590231,
49-
"node_id": "RA_kwDOACQFs84LAJ-X",
50-
"name": "wp-cli-999.9.9.phar",
51-
"label": null,
52-
"content_type": "application/octet-stream",
53-
"state": "uploaded",
54-
"size": 7048108,
55-
"download_count": 722639,
56-
"created_at": "2024-08-08T03:51:05Z",
57-
"updated_at": "2024-08-08T03:51:08Z",
58-
"browser_download_url": "https://github.com/wp-cli/wp-cli/releases/download/v999.9.9/wp-cli-999.9.9.phar"
9+
[
10+
{
11+
"url": "https://api.github.com/repos/wp-cli/wp-cli/releases/169243978",
12+
"assets_url": "https://api.github.com/repos/wp-cli/wp-cli/releases/169243978/assets",
13+
"upload_url": "https://uploads.github.com/repos/wp-cli/wp-cli/releases/169243978/assets{?name,label}",
14+
"html_url": "https://github.com/wp-cli/wp-cli/releases/tag/v999.9.9",
15+
"id": 169243978,
16+
"author": {
17+
"login": "schlessera",
18+
"id": 83631,
19+
"node_id": "MDQ6VXNlcjgzNjMx",
20+
"avatar_url": "https://avatars.githubusercontent.com/u/83631?v=4",
21+
"gravatar_id": "",
22+
"url": "https://api.github.com/users/schlessera",
23+
"html_url": "https://github.com/schlessera",
24+
"followers_url": "https://api.github.com/users/schlessera/followers",
25+
"following_url": "https://api.github.com/users/schlessera/following{/other_user}",
26+
"gists_url": "https://api.github.com/users/schlessera/gists{/gist_id}",
27+
"starred_url": "https://api.github.com/users/schlessera/starred{/owner}{/repo}",
28+
"subscriptions_url": "https://api.github.com/users/schlessera/subscriptions",
29+
"organizations_url": "https://api.github.com/users/schlessera/orgs",
30+
"repos_url": "https://api.github.com/users/schlessera/repos",
31+
"events_url": "https://api.github.com/users/schlessera/events{/privacy}",
32+
"received_events_url": "https://api.github.com/users/schlessera/received_events",
33+
"type": "User",
34+
"user_view_type": "public",
35+
"site_admin": false
36+
},
37+
"node_id": "RE_kwDOACQFs84KFnVK",
38+
"tag_name": "v999.9.9",
39+
"target_commitish": "main",
40+
"name": "Version 999.9.9",
41+
"draft": false,
42+
"prerelease": false,
43+
"created_at": "2024-08-08T03:04:55Z",
44+
"published_at": "2024-08-08T03:51:13Z",
45+
"assets": [
46+
{
47+
"url": "https://api.github.com/repos/wp-cli/wp-cli/releases/assets/184590231",
48+
"id": 184590231,
49+
"node_id": "RA_kwDOACQFs84LAJ-X",
50+
"name": "wp-cli-999.9.9.phar",
51+
"label": null,
52+
"content_type": "application/octet-stream",
53+
"state": "uploaded",
54+
"size": 7048108,
55+
"download_count": 722639,
56+
"created_at": "2024-08-08T03:51:05Z",
57+
"updated_at": "2024-08-08T03:51:08Z",
58+
"browser_download_url": "https://github.com/wp-cli/wp-cli/releases/download/v999.9.9/wp-cli-999.9.9.phar"
59+
}
60+
],
61+
"tarball_url": "https://api.github.com/repos/wp-cli/wp-cli/tarball/v999.9.9",
62+
"zipball_url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/v999.9.9",
63+
"body": "- Allow manually dispatching tests workflow [[#5965](https://github.com/wp-cli/wp-cli/pull/5965)]\r\n- Add fish shell completion [[#5954](https://github.com/wp-cli/wp-cli/pull/5954)]\r\n- Add defaults and accepted values for runcommand() options in doc [[#5953](https://github.com/wp-cli/wp-cli/pull/5953)]\r\n- Address warnings with filenames ending in fullstop on Windows [[#5951](https://github.com/wp-cli/wp-cli/pull/5951)]\r\n- Fix unit tests [[#5950](https://github.com/wp-cli/wp-cli/pull/5950)]\r\n- Update copyright year in license [[#5942](https://github.com/wp-cli/wp-cli/pull/5942)]\r\n- Fix breaking multi-line CSV values on reading [[#5939](https://github.com/wp-cli/wp-cli/pull/5939)]\r\n- Fix broken Gutenberg test [[#5938](https://github.com/wp-cli/wp-cli/pull/5938)]\r\n- Update docker runner to resolve docker path using `/usr/bin/env` [[#5936](https://github.com/wp-cli/wp-cli/pull/5936)]\r\n- Fix `inherit` path in nested directory [[#5930](https://github.com/wp-cli/wp-cli/pull/5930)]\r\n- Minor docblock improvements [[#5929](https://github.com/wp-cli/wp-cli/pull/5929)]\r\n- Add Signup fetcher [[#5926](https://github.com/wp-cli/wp-cli/pull/5926)]\r\n- Ensure the alias has the leading `@` symbol when added [[#5924](https://github.com/wp-cli/wp-cli/pull/5924)]\r\n- Include any non default hook information in CompositeCommand [[#5921](https://github.com/wp-cli/wp-cli/pull/5921)]\r\n- Correct completion case when ends in = [[#5913](https://github.com/wp-cli/wp-cli/pull/5913)]\r\n- Docs: Fixes for inline comments [[#5912](https://github.com/wp-cli/wp-cli/pull/5912)]\r\n- Update Inline comments [[#5910](https://github.com/wp-cli/wp-cli/pull/5910)]\r\n- Add a real-world example for `wp cli has-command` [[#5908](https://github.com/wp-cli/wp-cli/pull/5908)]\r\n- Fix typos [[#5901](https://github.com/wp-cli/wp-cli/pull/5901)]\r\n- Avoid PHP deprecation notices in PHP 8.1.x [[#5899](https://github.com/wp-cli/wp-cli/pull/5899)]",
64+
"reactions": {
65+
"url": "https://api.github.com/repos/wp-cli/wp-cli/releases/169243978/reactions",
66+
"total_count": 9,
67+
"+1": 4,
68+
"-1": 0,
69+
"laugh": 0,
70+
"hooray": 1,
71+
"confused": 0,
72+
"heart": 0,
73+
"rocket": 4,
74+
"eyes": 0
5975
}
60-
],
61-
"tarball_url": "https://api.github.com/repos/wp-cli/wp-cli/tarball/v999.9.9",
62-
"zipball_url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/v999.9.9",
63-
"body": "- Allow manually dispatching tests workflow [[#5965](https://github.com/wp-cli/wp-cli/pull/5965)]\r\n- Add fish shell completion [[#5954](https://github.com/wp-cli/wp-cli/pull/5954)]\r\n- Add defaults and accepted values for runcommand() options in doc [[#5953](https://github.com/wp-cli/wp-cli/pull/5953)]\r\n- Address warnings with filenames ending in fullstop on Windows [[#5951](https://github.com/wp-cli/wp-cli/pull/5951)]\r\n- Fix unit tests [[#5950](https://github.com/wp-cli/wp-cli/pull/5950)]\r\n- Update copyright year in license [[#5942](https://github.com/wp-cli/wp-cli/pull/5942)]\r\n- Fix breaking multi-line CSV values on reading [[#5939](https://github.com/wp-cli/wp-cli/pull/5939)]\r\n- Fix broken Gutenberg test [[#5938](https://github.com/wp-cli/wp-cli/pull/5938)]\r\n- Update docker runner to resolve docker path using `/usr/bin/env` [[#5936](https://github.com/wp-cli/wp-cli/pull/5936)]\r\n- Fix `inherit` path in nested directory [[#5930](https://github.com/wp-cli/wp-cli/pull/5930)]\r\n- Minor docblock improvements [[#5929](https://github.com/wp-cli/wp-cli/pull/5929)]\r\n- Add Signup fetcher [[#5926](https://github.com/wp-cli/wp-cli/pull/5926)]\r\n- Ensure the alias has the leading `@` symbol when added [[#5924](https://github.com/wp-cli/wp-cli/pull/5924)]\r\n- Include any non default hook information in CompositeCommand [[#5921](https://github.com/wp-cli/wp-cli/pull/5921)]\r\n- Correct completion case when ends in = [[#5913](https://github.com/wp-cli/wp-cli/pull/5913)]\r\n- Docs: Fixes for inline comments [[#5912](https://github.com/wp-cli/wp-cli/pull/5912)]\r\n- Update Inline comments [[#5910](https://github.com/wp-cli/wp-cli/pull/5910)]\r\n- Add a real-world example for `wp cli has-command` [[#5908](https://github.com/wp-cli/wp-cli/pull/5908)]\r\n- Fix typos [[#5901](https://github.com/wp-cli/wp-cli/pull/5901)]\r\n- Avoid PHP deprecation notices in PHP 8.1.x [[#5899](https://github.com/wp-cli/wp-cli/pull/5899)]",
64-
"reactions": {
65-
"url": "https://api.github.com/repos/wp-cli/wp-cli/releases/169243978/reactions",
66-
"total_count": 9,
67-
"+1": 4,
68-
"-1": 0,
69-
"laugh": 0,
70-
"hooray": 1,
71-
"confused": 0,
72-
"heart": 0,
73-
"rocket": 4,
74-
"eyes": 0
7576
}
76-
}
77-
]
78-
"""
77+
]
78+
"""
7979

8080
When I try `wp cli check-update --format=csv`
8181
Then STDOUT should contain:
82-
"""
83-
999.9.9,major,https://github.com/wp-cli/wp-cli/releases/download/v999.9.9/wp-cli-999.9.9.phar,available
84-
"""
82+
"""
83+
999.9.9,major,https://github.com/wp-cli/wp-cli/releases/download/v999.9.9/wp-cli-999.9.9.phar,available
84+
"""
8585

8686
Scenario: Mock HTTP request in WordPress
8787
Given a WP install
8888
And that HTTP requests to https://api.wordpress.org/core/version-check/1.7/ will respond with:
89-
"""
90-
HTTP/1.1 200
91-
Content-Type: application/json
89+
"""
90+
HTTP/1.1 200
91+
Content-Type: application/json
9292
93-
{
94-
"offers": [
95-
{
96-
"response": "latest",
97-
"download": "https:\/\/downloads.wordpress.org\/release\/wordpress-999.9.9.zip",
98-
"locale": "en_US",
99-
"packages": {
100-
"full": "https:\/\/downloads.wordpress.org\/release\/wordpress-999.9.9.zip",
101-
"no_content": "https:\/\/downloads.wordpress.org\/release\/wordpress-999.9.9-no-content.zip",
102-
"new_bundled": "https:\/\/downloads.wordpress.org\/release\/wordpress-999.9.9-new-bundled.zip",
103-
"partial": false,
104-
"rollback": false
105-
},
106-
"current": "999.9.9",
107-
"version": "999.9.9",
108-
"php_version": "7.2.24",
109-
"mysql_version": "5.5.5",
110-
"new_bundled": "6.7",
111-
"partial_version": false
112-
}
113-
],
114-
"translations": []
115-
}
116-
"""
93+
{
94+
"offers": [
95+
{
96+
"response": "latest",
97+
"download": "https:\/\/downloads.wordpress.org\/release\/wordpress-999.9.9.zip",
98+
"locale": "en_US",
99+
"packages": {
100+
"full": "https:\/\/downloads.wordpress.org\/release\/wordpress-999.9.9.zip",
101+
"no_content": "https:\/\/downloads.wordpress.org\/release\/wordpress-999.9.9-no-content.zip",
102+
"new_bundled": "https:\/\/downloads.wordpress.org\/release\/wordpress-999.9.9-new-bundled.zip",
103+
"partial": false,
104+
"rollback": false
105+
},
106+
"current": "999.9.9",
107+
"version": "999.9.9",
108+
"php_version": "7.2.24",
109+
"mysql_version": "5.5.5",
110+
"new_bundled": "6.7",
111+
"partial_version": false
112+
}
113+
],
114+
"translations": []
115+
}
116+
"""
117117

118118
When I run `wp core check-update`
119119
Then STDOUT should be a table containing rows:

features/steps.feature

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Feature: Make sure "Given", "When", "Then" steps work as expected
33
Scenario: Variable names can only contain uppercase letters, digits and underscores and cannot begin with a digit.
44

55
When I run `echo value`
6-
And save STDOUT as {VARIABLE_NAME}
6+
Then save STDOUT as {VARIABLE_NAME}
77
And save STDOUT as {V}
88
And save STDOUT as {_VARIABLE_NAME_STARTING_WITH_UNDERSCORE}
99
And save STDOUT as {_}
@@ -20,9 +20,9 @@ Feature: Make sure "Given", "When", "Then" steps work as expected
2020
When I run `echo {VARIABLE_NAME}`
2121
Then STDOUT should match /^value$/
2222
And STDOUT should be:
23-
"""
24-
value
25-
"""
23+
"""
24+
value
25+
"""
2626

2727
When I run `echo {V}`
2828
Then STDOUT should match /^value$/
@@ -45,9 +45,9 @@ Feature: Make sure "Given", "When", "Then" steps work as expected
4545
When I run `echo {2_VARIABLE_NAME_STARTING_WITH_DIGIT}`
4646
Then STDOUT should match /^\{2_VARIABLE_NAME_STARTING_WITH_DIGIT}$/
4747
And STDOUT should contain:
48-
"""
49-
{
50-
"""
48+
"""
49+
{
50+
"""
5151

5252
When I run `echo {2}`
5353
Then STDOUT should match /^\{2}$/
@@ -61,7 +61,7 @@ Feature: Make sure "Given", "When", "Then" steps work as expected
6161
Scenario: Special variables
6262

6363
When I run `echo {INVOKE_WP_CLI_WITH_PHP_ARGS-} cli info`
64-
And STDOUT should match /wp cli info/
64+
Then STDOUT should match /wp cli info/
6565
And STDERR should be empty
6666

6767
When I run `echo {WP_VERSION-latest}`

features/testing.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ Feature: Test that WP-CLI loads.
1212
Scenario: WP Cron is disabled by default
1313
Given a WP install
1414
And a test_cron.php file:
15-
"""
16-
<?php
17-
$cron_disabled = defined( "DISABLE_WP_CRON" ) ? DISABLE_WP_CRON : false;
18-
echo 'DISABLE_WP_CRON is: ' . ( $cron_disabled ? 'true' : 'false' );
19-
"""
15+
"""
16+
<?php
17+
$cron_disabled = defined( "DISABLE_WP_CRON" ) ? DISABLE_WP_CRON : false;
18+
echo 'DISABLE_WP_CRON is: ' . ( $cron_disabled ? 'true' : 'false' );
19+
"""
2020

2121
When I run `wp eval-file test_cron.php`
2222
Then STDOUT should be:

0 commit comments

Comments
 (0)