Skip to content

Commit b4238ea

Browse files
authored
Merge pull request #351 from wp-cli/refine-feature-files
2 parents d296bb7 + 53f9c1d commit b4238ea

File tree

3 files changed

+121
-122
lines changed

3 files changed

+121
-122
lines changed

features/install-wp-tests.feature

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,31 @@ Feature: Scaffold install-wp-tests.sh tests
1818
Scenario: Install latest version of WordPress
1919
Given a WP install
2020
And a affirmative-response file:
21-
"""
22-
Y
23-
"""
21+
"""
22+
Y
23+
"""
2424
And a negative-response file:
25-
"""
26-
No
27-
"""
25+
"""
26+
No
27+
"""
2828
And a get-phpunit-phar-url.php file:
29-
"""
30-
<?php
31-
$version = 4;
32-
if(PHP_VERSION_ID >= 50600) {
33-
$version = 5;
34-
}
35-
if(PHP_VERSION_ID >= 70000) {
36-
$version = 6;
37-
}
38-
if(PHP_VERSION_ID >= 70100) {
39-
$version = 7;
40-
}
41-
if(PHP_VERSION_ID >= 80000) {
42-
$version = 9;
43-
}
44-
echo "https://phar.phpunit.de/phpunit-{$version}.phar";
45-
"""
29+
"""
30+
<?php
31+
$version = 4;
32+
if(PHP_VERSION_ID >= 50600) {
33+
$version = 5;
34+
}
35+
if(PHP_VERSION_ID >= 70000) {
36+
$version = 6;
37+
}
38+
if(PHP_VERSION_ID >= 70100) {
39+
$version = 7;
40+
}
41+
if(PHP_VERSION_ID >= 80000) {
42+
$version = 9;
43+
}
44+
echo "https://phar.phpunit.de/phpunit-{$version}.phar";
45+
"""
4646
And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress`
4747
And save STDOUT as {PHPUNIT_PHAR_URL}
4848
And I run `wget -q -O phpunit {PHPUNIT_PHAR_URL}`
@@ -97,7 +97,7 @@ Feature: Scaffold install-wp-tests.sh tests
9797

9898
# This throws a warning for the password provided via command line.
9999
When I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "SHOW DATABASES"`
100-
And STDOUT should contain:
100+
Then STDOUT should contain:
101101
"""
102102
wp_cli_test_scaffold
103103
"""
@@ -137,31 +137,31 @@ Feature: Scaffold install-wp-tests.sh tests
137137
Scenario: Install latest version of WordPress on PHP 8.0+ and WordPress less then 5.8
138138
Given a WP install
139139
And a affirmative-response file:
140-
"""
141-
Y
142-
"""
140+
"""
141+
Y
142+
"""
143143
And a negative-response file:
144-
"""
145-
No
146-
"""
144+
"""
145+
No
146+
"""
147147
And a get-phpunit-phar-url.php file:
148-
"""
149-
<?php
150-
$version = 4;
151-
if(PHP_VERSION_ID >= 50600) {
152-
$version = 5;
153-
}
154-
if(PHP_VERSION_ID >= 70000) {
155-
$version = 6;
156-
}
157-
if(PHP_VERSION_ID >= 70100) {
158-
$version = 7;
159-
}
160-
if(PHP_VERSION_ID >= 80000) {
161-
$version = 9;
162-
}
163-
echo "https://phar.phpunit.de/phpunit-{$version}.phar";
164-
"""
148+
"""
149+
<?php
150+
$version = 4;
151+
if(PHP_VERSION_ID >= 50600) {
152+
$version = 5;
153+
}
154+
if(PHP_VERSION_ID >= 70000) {
155+
$version = 6;
156+
}
157+
if(PHP_VERSION_ID >= 70100) {
158+
$version = 7;
159+
}
160+
if(PHP_VERSION_ID >= 80000) {
161+
$version = 9;
162+
}
163+
echo "https://phar.phpunit.de/phpunit-{$version}.phar";
164+
"""
165165
And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress`
166166
And save STDOUT as {PHPUNIT_PHAR_URL}
167167
And I run `wget -q -O phpunit {PHPUNIT_PHAR_URL}`
@@ -216,7 +216,7 @@ Feature: Scaffold install-wp-tests.sh tests
216216
217217
# This throws a warning for the password provided via command line.
218218
When I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "SHOW DATABASES"`
219-
And STDOUT should contain:
219+
Then STDOUT should contain:
220220
"""
221221
wp_cli_test_scaffold
222222
"""
@@ -268,31 +268,31 @@ Feature: Scaffold install-wp-tests.sh tests
268268
Scenario: Install latest version of WordPress on PHP 8.0+ and WordPress above 5.8
269269
Given a WP install
270270
And a affirmative-response file:
271-
"""
272-
Y
273-
"""
271+
"""
272+
Y
273+
"""
274274
And a negative-response file:
275-
"""
276-
No
277-
"""
275+
"""
276+
No
277+
"""
278278
And a get-phpunit-phar-url.php file:
279-
"""
280-
<?php
281-
$version = 4;
282-
if(PHP_VERSION_ID >= 50600) {
283-
$version = 5;
284-
}
285-
if(PHP_VERSION_ID >= 70000) {
286-
$version = 6;
287-
}
288-
if(PHP_VERSION_ID >= 70100) {
289-
$version = 7;
290-
}
291-
if(PHP_VERSION_ID >= 80000) {
292-
$version = 9;
293-
}
294-
echo "https://phar.phpunit.de/phpunit-{$version}.phar";
295-
"""
279+
"""
280+
<?php
281+
$version = 4;
282+
if(PHP_VERSION_ID >= 50600) {
283+
$version = 5;
284+
}
285+
if(PHP_VERSION_ID >= 70000) {
286+
$version = 6;
287+
}
288+
if(PHP_VERSION_ID >= 70100) {
289+
$version = 7;
290+
}
291+
if(PHP_VERSION_ID >= 80000) {
292+
$version = 9;
293+
}
294+
echo "https://phar.phpunit.de/phpunit-{$version}.phar";
295+
"""
296296
And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress`
297297
And save STDOUT as {PHPUNIT_PHAR_URL}
298298
And I run `wget -q -O phpunit {PHPUNIT_PHAR_URL}`
@@ -347,7 +347,7 @@ Feature: Scaffold install-wp-tests.sh tests
347347
348348
# This throws a warning for the password provided via command line.
349349
When I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "SHOW DATABASES"`
350-
And STDOUT should contain:
350+
Then STDOUT should contain:
351351
"""
352352
wp_cli_test_scaffold
353353
"""
@@ -387,23 +387,23 @@ Feature: Scaffold install-wp-tests.sh tests
387387
Scenario: Install WordPress from trunk
388388
Given a WP install
389389
And a get-phpunit-phar-url.php file:
390-
"""
391-
<?php
392-
$version = 4;
393-
if(PHP_VERSION_ID >= 50600) {
394-
$version = 5;
395-
}
396-
if(PHP_VERSION_ID >= 70000) {
397-
$version = 6;
398-
}
399-
if(PHP_VERSION_ID >= 70100) {
400-
$version = 7;
401-
}
402-
if(PHP_VERSION_ID >= 80000) {
403-
$version = 9;
404-
}
405-
echo "https://phar.phpunit.de/phpunit-{$version}.phar";
406-
"""
390+
"""
391+
<?php
392+
$version = 4;
393+
if(PHP_VERSION_ID >= 50600) {
394+
$version = 5;
395+
}
396+
if(PHP_VERSION_ID >= 70000) {
397+
$version = 6;
398+
}
399+
if(PHP_VERSION_ID >= 70100) {
400+
$version = 7;
401+
}
402+
if(PHP_VERSION_ID >= 80000) {
403+
$version = 9;
404+
}
405+
echo "https://phar.phpunit.de/phpunit-{$version}.phar";
406+
"""
407407
And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress`
408408
And save STDOUT as {PHPUNIT_PHAR_URL}
409409
And I run `wget -q -O phpunit {PHPUNIT_PHAR_URL}`
@@ -471,7 +471,7 @@ Feature: Scaffold install-wp-tests.sh tests
471471
472472
# This throws a warning for the password provided via command line.
473473
When I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "SHOW DATABASES"`
474-
And STDOUT should contain:
474+
Then STDOUT should contain:
475475
"""
476476
wp_cli_test_scaffold
477477
"""

features/scaffold-block.feature

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ Feature: WordPress block code scaffolding
22

33
Background:
44
Given a WP install
5-
Given I run `wp scaffold plugin movies`
5+
And I run `wp scaffold plugin movies`
66
And I run `wp plugin path movies --dir`
77
And save STDOUT as {PLUGIN_DIR}
8-
Given I run `wp theme install twentytwelve --activate --force`
8+
And I run `wp theme install twentytwelve --activate --force`
99
And I run `wp theme path twentytwelve --dir`
1010
And save STDOUT as {THEME_DIR}
1111

12-
1312
Scenario: Scaffold a block with an invalid slug
1413
When I try `wp scaffold block The_Godfather`
1514
Then STDERR should be:

0 commit comments

Comments
 (0)