Skip to content

Commit 05303d5

Browse files
schlesseraclaude
andcommitted
Use {PLUGIN_DIR} and {THEME_DIR} in tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 054de43 commit 05303d5

5 files changed

Lines changed: 1 addition & 43 deletions

File tree

‎features/install-wp-tests.feature‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ Feature: Scaffold install-wp-tests.sh tests
55
@skip-windows
66
Scenario: Help should be displayed
77
Given a WP install
8-
And I run `wp plugin path`
9-
And save STDOUT as {PLUGIN_DIR}
108
And I run `wp scaffold plugin hello-world`
119

1210
When I try `/usr/bin/env bash {PLUGIN_DIR}/hello-world/bin/install-wp-tests.sh`
@@ -48,8 +46,6 @@ Feature: Scaffold install-wp-tests.sh tests
4846
And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress`
4947
And save STDOUT as {PHPUNIT_PHAR_URL}
5048
And I run `curl -sS -L --fail -o phpunit {PHPUNIT_PHAR_URL}`
51-
And I run `wp plugin path`
52-
And save STDOUT as {PLUGIN_DIR}
5349
And I run `wp scaffold plugin hello-world`
5450
# This throws a warning for the password provided via command line.
5551
And I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`
@@ -166,8 +162,6 @@ Feature: Scaffold install-wp-tests.sh tests
166162
And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress`
167163
And save STDOUT as {PHPUNIT_PHAR_URL}
168164
And I run `curl -sS --fail -L -o phpunit {PHPUNIT_PHAR_URL}`
169-
And I run `wp plugin path`
170-
And save STDOUT as {PLUGIN_DIR}
171165
And I run `wp scaffold plugin hello-world`
172166
# This throws a warning for the password provided via command line.
173167
And I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`
@@ -296,8 +290,6 @@ Feature: Scaffold install-wp-tests.sh tests
296290
And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress`
297291
And save STDOUT as {PHPUNIT_PHAR_URL}
298292
And I run `curl -sS -L --fail -o phpunit {PHPUNIT_PHAR_URL}`
299-
And I run `wp plugin path`
300-
And save STDOUT as {PLUGIN_DIR}
301293
And I run `wp scaffold plugin hello-world`
302294
# This throws a warning for the password provided via command line.
303295
And I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`
@@ -406,8 +398,6 @@ Feature: Scaffold install-wp-tests.sh tests
406398
And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress`
407399
And save STDOUT as {PHPUNIT_PHAR_URL}
408400
And I run `curl -sS -f -L -o phpunit {PHPUNIT_PHAR_URL}`
409-
And I run `wp plugin path`
410-
And save STDOUT as {PLUGIN_DIR}
411401
And I run `wp scaffold plugin hello-world`
412402
# This throws a warning for the password provided via command line.
413403
And I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`
@@ -486,8 +476,6 @@ Feature: Scaffold install-wp-tests.sh tests
486476
@require-mysql
487477
Scenario: Install WordPress 3.7 and phpunit will not run
488478
Given a WP install
489-
And I run `wp plugin path`
490-
And save STDOUT as {PLUGIN_DIR}
491479
And I run `wp scaffold plugin hello-world`
492480
# This throws a warning for the password provided via command line.
493481
And I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"`

‎features/scaffold-lint.feature‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ Feature: Lint scaffolded code
22

33
Background:
44
Given a WP install
5-
And I run `wp plugin path`
6-
And save STDOUT as {PLUGIN_DIR}
75

86
# Create a helper plugin to install phpcs once for all scenarios
97
When I run `wp scaffold plugin phpcs-helper --skip-tests`
@@ -71,10 +69,8 @@ Feature: Lint scaffolded code
7169
"""
7270
twentytwentyone --force
7371
"""
74-
When I run `wp theme path`
75-
And save STDOUT as {THEME_DIR}
7672

77-
And I run `wp scaffold child-theme test-child --parent_theme=twentytwentyone`
73+
When I run `wp scaffold child-theme test-child --parent_theme=twentytwentyone`
7874
Then STDOUT should not be empty
7975
And the {THEME_DIR}/test-child/functions.php file should exist
8076

‎features/scaffold-plugin-tests.feature‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ Feature: Scaffold plugin unit tests
44
@skip-windows
55
Scenario: Scaffold plugin tests
66
Given a WP install
7-
When I run `wp plugin path`
8-
Then save STDOUT as {PLUGIN_DIR}
97

108
When I run `wp scaffold plugin hello-world --skip-tests`
119
Then STDOUT should not be empty
@@ -342,8 +340,6 @@ Feature: Scaffold plugin unit tests
342340

343341
Scenario: Accept bitbucket as valid CI in plugin scaffold
344342
Given a WP install
345-
When I run `wp plugin path`
346-
Then save STDOUT as {PLUGIN_DIR}
347343

348344
When I run `wp scaffold plugin hello-world --ci=bitbucket`
349345
Then STDOUT should not be empty

‎features/scaffold-theme-tests.feature‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ Feature: Scaffold theme unit tests
88
"""
99
And I run `wp scaffold child-theme t12child --parent_theme=twentytwelve`
1010

11-
When I run `wp theme path`
12-
Then save STDOUT as {THEME_DIR}
13-
1411
@require-php-7.4 @require-mysql
1512
Scenario: Scaffold theme tests
1613
When I run `wp scaffold theme-tests t12child`

‎features/scaffold.feature‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ Feature: WordPress code scaffolding
33
@theme
44
Scenario: Scaffold a child theme
55
Given a WP install
6-
And I run `wp theme path`
7-
And save STDOUT as {THEME_DIR}
86

97
When I run `wp scaffold child-theme zombieland --parent_theme=umbrella --theme_name=Zombieland --author=Tallahassee --author_uri=https://wp-cli.org --theme_uri=http://www.zombieland.com`
108
Then the {THEME_DIR}/zombieland/style.css file should exist
@@ -21,8 +19,6 @@ Feature: WordPress code scaffolding
2119

2220
Scenario: Scaffold a child theme with only --parent_theme parameter
2321
Given a WP install
24-
And I run `wp theme path`
25-
And save STDOUT as {THEME_DIR}
2622

2723
When I run `wp scaffold child-theme hello-world --parent_theme=simple-life`
2824
Then STDOUT should not be empty
@@ -68,9 +64,6 @@ Feature: WordPress code scaffolding
6864
When I run `wp theme install twentytwentyone --force`
6965
Then STDOUT should not be empty
7066

71-
And I run `wp theme path`
72-
And save STDOUT as {THEME_DIR}
73-
7467
When I run `wp scaffold child-theme first-run --parent_theme=twentytwentyone --theme_name="First Run Name" --activate`
7568
Then STDOUT should contain:
7669
"""
@@ -129,8 +122,6 @@ Feature: WordPress code scaffolding
129122
@theme
130123
Scenario: Scaffold a child theme with dots in the slug
131124
Given a WP install
132-
And I run `wp theme path`
133-
And save STDOUT as {THEME_DIR}
134125

135126
When I run `wp scaffold child-theme my-theme-2.0.1 --parent_theme=umbrella`
136127
Then the {THEME_DIR}/my-theme-2.0.1/functions.php file should exist
@@ -267,8 +258,6 @@ Feature: WordPress code scaffolding
267258

268259
Scenario: Scaffold a plugin
269260
Given a WP install
270-
And I run `wp plugin path`
271-
And save STDOUT as {PLUGIN_DIR}
272261
And I run `wp core version`
273262
And save STDOUT as {WP_VERSION}
274263

@@ -403,8 +392,6 @@ Feature: WordPress code scaffolding
403392
@require-php-5.6 @require-wp-4.6
404393
Scenario: Scaffold starter code for a theme
405394
Given a WP install
406-
And I run `wp theme path`
407-
And save STDOUT as {THEME_DIR}
408395
409396
# Allow for warnings to be generated due to https://github.com/wp-cli/scaffold-command/issues/181
410397
When I try `wp scaffold _s starter-theme`
@@ -418,8 +405,6 @@ Feature: WordPress code scaffolding
418405
@require-php-5.6 @require-wp-4.6
419406
Scenario: Scaffold starter code for a theme with sass
420407
Given a WP install
421-
And I run `wp theme path`
422-
And save STDOUT as {THEME_DIR}
423408
424409
# Allow for warnings to be generated due to https://github.com/wp-cli/scaffold-command/issues/181
425410
When I try `wp scaffold _s starter-theme --sassify`
@@ -432,8 +417,6 @@ Feature: WordPress code scaffolding
432417
@require-php-5.6 @require-wp-4.6
433418
Scenario: Scaffold starter code for a WooCommerce theme
434419
Given a WP install
435-
And I run `wp theme path`
436-
And save STDOUT as {THEME_DIR}
437420
438421
# Allow for warnings to be generated due to https://github.com/wp-cli/scaffold-command/issues/181
439422
When I try `wp scaffold _s starter-theme --woocommerce`
@@ -532,8 +515,6 @@ Feature: WordPress code scaffolding
532515
Given a WP install
533516
When I run `wp core version`
534517
Then save STDOUT as {WP_VERSION}
535-
When I run `wp plugin path`
536-
Then save STDOUT as {PLUGIN_DIR}
537518
538519
When I run `wp scaffold plugin hello-world`
539520
Then STDOUT should not be empty

0 commit comments

Comments
 (0)