@@ -2,45 +2,45 @@ Feature: Scaffold theme unit tests
22
33 Background :
44 Given a WP install
5- And I run `wp theme install p2 `
6- And I run `wp scaffold child-theme p2child --parent_theme=p2 `
5+ And I try `wp theme install twentytwelve --force `
6+ And I run `wp scaffold child-theme t12child --parent_theme=twentytwelve `
77
88 When I run `wp theme path`
99 Then save STDOUT as {THEME_DIR}
1010
1111 @require-php-7.0 @less-than-php-7.2 @require-mysql
1212 Scenario : Scaffold theme tests
13- When I run `wp scaffold theme-tests p2child `
13+ When I run `wp scaffold theme-tests t12child `
1414 Then STDOUT should not be empty
15- And the {THEME_DIR}/p2child /tests directory should contain:
15+ And the {THEME_DIR}/t12child /tests directory should contain:
1616 """
1717 bootstrap.php
1818 test-sample.php
1919 """
20- And the {THEME_DIR}/p2child /tests/bootstrap.php file should contain:
20+ And the {THEME_DIR}/t12child /tests/bootstrap.php file should contain:
2121 """
2222 register_theme_directory( $theme_root );
2323 """
24- And the {THEME_DIR}/p2child /tests/bootstrap.php file should contain:
24+ And the {THEME_DIR}/t12child /tests/bootstrap.php file should contain:
2525 """
26- * @package P2child
26+ * @package T12child
2727 """
28- And the {THEME_DIR}/p2child /tests/test-sample.php file should contain:
28+ And the {THEME_DIR}/t12child /tests/test-sample.php file should contain:
2929 """
30- * @package P2child
30+ * @package T12child
3131 """
32- And the {THEME_DIR}/p2child /bin directory should contain:
32+ And the {THEME_DIR}/t12child /bin directory should contain:
3333 """
3434 install-wp-tests.sh
3535 """
36- And the {THEME_DIR}/p2child /phpunit.xml.dist file should contain:
36+ And the {THEME_DIR}/t12child /phpunit.xml.dist file should contain:
3737 """
3838 <exclude>./tests/test-sample.php</exclude>
3939 """
40- And the {THEME_DIR}/p2child /.phpcs.xml.dist file should exist
41- And the {THEME_DIR}/p2child /bitbucket-pipelines.yml file should not exist
42- And the {THEME_DIR}/p2child /.gitlab-ci.yml file should not exist
43- And the {THEME_DIR}/p2child /.circleci/config.yml file should contain:
40+ And the {THEME_DIR}/t12child /.phpcs.xml.dist file should exist
41+ And the {THEME_DIR}/t12child /bitbucket-pipelines.yml file should not exist
42+ And the {THEME_DIR}/t12child /.gitlab-ci.yml file should not exist
43+ And the {THEME_DIR}/t12child /.circleci/config.yml file should contain:
4444 """
4545 jobs:
4646 php56-build:
@@ -49,7 +49,7 @@ Feature: Scaffold theme unit tests
4949 - image: circleci/php:5.6
5050 - image: *mysql_image
5151 """
52- And the {THEME_DIR}/p2child /.circleci/config.yml file should contain:
52+ And the {THEME_DIR}/t12child /.circleci/config.yml file should contain:
5353 """
5454 workflows:
5555 version: 2
@@ -63,27 +63,27 @@ Feature: Scaffold theme unit tests
6363 - php74-build
6464 """
6565
66- When I run `wp eval "if ( is_executable( '{THEME_DIR}/p2child /bin/install-wp-tests.sh' ) ) { echo 'executable'; } else { exit( 1 ); }" `
66+ When I run `wp eval "if ( is_executable( '{THEME_DIR}/t12child /bin/install-wp-tests.sh' ) ) { echo 'executable'; } else { exit( 1 ); }" `
6767 Then STDOUT should be:
6868 """
6969 executable
7070 """
7171
7272 # Warning: overwriting generated functions.php file, so functions.php file loaded only tests beyond here...
73- Given a wp-content/themes/p2child /functions.php file:
73+ Given a wp-content/themes/t12child /functions.php file:
7474 """
7575 <?php echo __FILE__ . " loaded.\n";
7676 """
7777 # This throws a warning for the password provided via command line.
7878 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" `
7979
80- And I try `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_CORE_DIR={RUN_DIR}/wordpress {THEME_DIR}/p2child /bin/install-wp-tests.sh wp_cli_test_scaffold {DB_USER} {DB_PASSWORD} {DB_HOST} latest`
80+ And I try `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_CORE_DIR={RUN_DIR}/wordpress {THEME_DIR}/t12child /bin/install-wp-tests.sh wp_cli_test_scaffold {DB_USER} {DB_PASSWORD} {DB_HOST} latest`
8181 Then the return code should be 0
8282
83- When I run `cd {THEME_DIR}/p2child ; WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib phpunit`
83+ When I run `cd {THEME_DIR}/t12child ; WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib phpunit`
8484 Then STDOUT should contain:
8585 """
86- p2child /functions.php loaded.
86+ t12child /functions.php loaded.
8787 """
8888 And STDOUT should contain:
8989 """
@@ -94,10 +94,10 @@ Feature: Scaffold theme unit tests
9494 No tests executed!
9595 """
9696
97- When I run `cd {THEME_DIR}/p2child ; WP_MULTISITE=1 WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib phpunit`
97+ When I run `cd {THEME_DIR}/t12child ; WP_MULTISITE=1 WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib phpunit`
9898 Then STDOUT should contain:
9999 """
100- p2child /functions.php loaded.
100+ t12child /functions.php loaded.
101101 """
102102 And STDOUT should contain:
103103 """
@@ -117,55 +117,55 @@ Feature: Scaffold theme unit tests
117117 And the return code should be 1
118118
119119 Scenario : Scaffold theme tests with Circle as the provider
120- When I run `wp scaffold theme-tests p2child --ci=circle`
120+ When I run `wp scaffold theme-tests t12child --ci=circle`
121121 Then STDOUT should not be empty
122- And the {THEME_DIR}/p2child /circle.yml file should not exist
123- And the {THEME_DIR}/p2child /.circleci/config.yml file should contain:
122+ And the {THEME_DIR}/t12child /circle.yml file should not exist
123+ And the {THEME_DIR}/t12child /.circleci/config.yml file should contain:
124124 """
125125 version: 2
126126 """
127- And the {THEME_DIR}/p2child /.circleci/config.yml file should contain:
127+ And the {THEME_DIR}/t12child /.circleci/config.yml file should contain:
128128 """
129129 php56-build
130130 """
131- And the {THEME_DIR}/p2child /.circleci/config.yml file should contain:
131+ And the {THEME_DIR}/t12child /.circleci/config.yml file should contain:
132132 """
133133 php70-build
134134 """
135- And the {THEME_DIR}/p2child /.circleci/config.yml file should contain:
135+ And the {THEME_DIR}/t12child /.circleci/config.yml file should contain:
136136 """
137137 php71-build
138138 """
139- And the {THEME_DIR}/p2child /.circleci/config.yml file should contain:
139+ And the {THEME_DIR}/t12child /.circleci/config.yml file should contain:
140140 """
141141 php72-build
142142 """
143- And the {THEME_DIR}/p2child /.circleci/config.yml file should contain:
143+ And the {THEME_DIR}/t12child /.circleci/config.yml file should contain:
144144 """
145145 php73-build
146146 """
147- And the {THEME_DIR}/p2child /.circleci/config.yml file should contain:
147+ And the {THEME_DIR}/t12child /.circleci/config.yml file should contain:
148148 """
149149 php74-build
150150 """
151151
152152 Scenario : Scaffold theme tests with Gitlab as the provider
153- When I run `wp scaffold theme-tests p2child --ci=gitlab`
153+ When I run `wp scaffold theme-tests t12child --ci=gitlab`
154154 Then STDOUT should not be empty
155- And the {THEME_DIR}/p2child /.gitlab-ci.yml file should contain:
155+ And the {THEME_DIR}/t12child /.gitlab-ci.yml file should contain:
156156 """
157157 MYSQL_DATABASE
158158 """
159159
160160 Scenario : Scaffold theme tests with Bitbucket Pipelines as the provider
161- When I run `wp scaffold theme-tests p2child --ci=bitbucket`
161+ When I run `wp scaffold theme-tests t12child --ci=bitbucket`
162162 Then STDOUT should not be empty
163- And the {THEME_DIR}/p2child /bitbucket-pipelines.yml file should contain:
163+ And the {THEME_DIR}/t12child /bitbucket-pipelines.yml file should contain:
164164 """
165165 pipelines:
166166 default:
167167 """
168- And the {THEME_DIR}/p2child /bitbucket-pipelines.yml file should contain:
168+ And the {THEME_DIR}/t12child /bitbucket-pipelines.yml file should contain:
169169 """
170170 - step:
171171 image: php:5.6
@@ -175,7 +175,7 @@ Feature: Scaffold theme unit tests
175175 - docker-php-ext-install mysqli
176176 - apt-get update && apt-get install -y subversion --no-install-recommends
177177 """
178- And the {THEME_DIR}/p2child /bitbucket-pipelines.yml file should contain:
178+ And the {THEME_DIR}/t12child /bitbucket-pipelines.yml file should contain:
179179 """
180180 - step:
181181 image: php:7.0
@@ -185,7 +185,7 @@ Feature: Scaffold theme unit tests
185185 - docker-php-ext-install mysqli
186186 - apt-get update && apt-get install -y subversion --no-install-recommends
187187 """
188- And the {THEME_DIR}/p2child /bitbucket-pipelines.yml file should contain:
188+ And the {THEME_DIR}/t12child /bitbucket-pipelines.yml file should contain:
189189 """
190190 - step:
191191 image: php:7.1
@@ -195,7 +195,7 @@ Feature: Scaffold theme unit tests
195195 - docker-php-ext-install mysqli
196196 - apt-get update && apt-get install -y subversion --no-install-recommends
197197 """
198- And the {THEME_DIR}/p2child /bitbucket-pipelines.yml file should contain:
198+ And the {THEME_DIR}/t12child /bitbucket-pipelines.yml file should contain:
199199 """
200200 - step:
201201 image: php:7.2
@@ -205,7 +205,7 @@ Feature: Scaffold theme unit tests
205205 - docker-php-ext-install mysqli
206206 - apt-get update && apt-get install -y subversion --no-install-recommends
207207 """
208- And the {THEME_DIR}/p2child /bitbucket-pipelines.yml file should contain:
208+ And the {THEME_DIR}/t12child /bitbucket-pipelines.yml file should contain:
209209 """
210210 definitions:
211211 services:
@@ -233,36 +233,36 @@ Feature: Scaffold theme unit tests
233233 And the return code should be 1
234234
235235 Scenario : Scaffold theme tests with invalid directory
236- When I try `wp scaffold theme-tests p2 --dir=non-existent-dir`
236+ When I try `wp scaffold theme-tests twentytwelve --dir=non-existent-dir`
237237 Then STDERR should be:
238238 """
239239 Error: Invalid theme directory specified. No such directory 'non-existent-dir'.
240240 """
241241 And the return code should be 1
242242
243243 # Temporarily move.
244- When I run `mv -f {THEME_DIR}/p2 {THEME_DIR}/hide-p2 && touch {THEME_DIR}/p2 `
244+ When I run `mv -f {THEME_DIR}/twentytwelve {THEME_DIR}/hide-twentytwelve && touch {THEME_DIR}/twentytwelve `
245245 Then the return code should be 0
246246
247- When I try `wp scaffold theme-tests p2 `
247+ When I try `wp scaffold theme-tests twentytwelve `
248248 Then STDERR should be:
249249 """
250- Error: Invalid theme slug specified. No such target directory '{THEME_DIR}/p2 '.
250+ Error: Invalid theme slug specified. No such target directory '{THEME_DIR}/twentytwelve '.
251251 """
252252 And the return code should be 1
253253
254254 # Restore.
255- When I run `rm -f {THEME_DIR}/p2 && mv -f {THEME_DIR}/hide-p2 {THEME_DIR}/p2 `
255+ When I run `rm -f {THEME_DIR}/twentytwelve && mv -f {THEME_DIR}/hide-twentytwelve {THEME_DIR}/twentytwelve `
256256 Then the return code should be 0
257257
258258 Scenario : Scaffold theme tests with a symbolic link
259259 # Temporarily move the whole theme dir and create a symbolic link to it.
260260 When I run `mv -f {THEME_DIR} {RUN_DIR}/alt-themes && ln -s {RUN_DIR}/alt-themes {THEME_DIR}`
261261 Then the return code should be 0
262262
263- When I run `wp scaffold theme-tests p2 `
263+ When I run `wp scaffold theme-tests twentytwelve `
264264 Then STDOUT should not be empty
265- And the {THEME_DIR}/p2 /tests directory should contain:
265+ And the {THEME_DIR}/twentytwelve /tests directory should contain:
266266 """
267267 bootstrap.php
268268 """
0 commit comments