You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress`
297
+
And save STDOUT as {PHPUNIT_PHAR_URL}
298
+
And I run `wget -q -O phpunit {PHPUNIT_PHAR_URL}`
299
+
And I run `chmod +x phpunit`
300
+
And I run `wp plugin path`
301
+
And save STDOUT as {PLUGIN_DIR}
302
+
And I run `wp scaffold plugin hello-world`
303
+
# This throws a warning for the password provided via command line.
304
+
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"`
305
+
306
+
When I try `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_CORE_DIR={RUN_DIR}/wordpress /usr/bin/env bash {PLUGIN_DIR}/hello-world/bin/install-wp-tests.sh wp_cli_test_scaffold {DB_USER} {DB_PASSWORD} {DB_HOST} latest`
307
+
Then the return code should be 0
308
+
And the {RUN_DIR}/wordpress-tests-lib directory should contain:
309
+
"""
310
+
data
311
+
"""
312
+
And the {RUN_DIR}/wordpress-tests-lib directory should contain:
313
+
"""
314
+
includes
315
+
"""
316
+
And the {RUN_DIR}/wordpress-tests-lib directory should contain:
317
+
"""
318
+
wp-tests-config.php
319
+
"""
320
+
And the {RUN_DIR}/wordpress directory should contain:
321
+
"""
322
+
index.php
323
+
license.txt
324
+
readme.html
325
+
wp-activate.php
326
+
wp-admin
327
+
wp-blog-header.php
328
+
wp-comments-post.php
329
+
wp-config-sample.php
330
+
wp-content
331
+
wp-cron.php
332
+
wp-includes
333
+
wp-links-opml.php
334
+
wp-load.php
335
+
wp-login.php
336
+
wp-mail.php
337
+
wp-settings.php
338
+
wp-signup.php
339
+
wp-trackback.php
340
+
xmlrpc.php
341
+
"""
342
+
And the {PLUGIN_DIR}/hello-world/phpunit.xml.dist file should exist
343
+
And STDERR should contain:
344
+
"""
345
+
install_test_suite
346
+
"""
347
+
348
+
# This throws a warning for the password provided via command line.
349
+
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:
351
+
"""
352
+
wp_cli_test_scaffold
353
+
"""
354
+
355
+
When I run `mkdir polyfills && composer init --name=test/package --require="yoast/phpunit-polyfills:^1" --no-interaction --quiet --working-dir=polyfills`
356
+
Then the return code should be 0
357
+
358
+
When I run `composer install --no-interaction --working-dir=polyfills --quiet`
359
+
Then the return code should be 0
360
+
361
+
When I run `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_TESTS_PHPUNIT_POLYFILLS_PATH={RUN_DIR}/polyfills/vendor/yoast/phpunit-polyfills ./phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist`
362
+
Then the return code should be 0
363
+
364
+
When I try `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_CORE_DIR={RUN_DIR}/wordpress /usr/bin/env bash {PLUGIN_DIR}/hello-world/bin/install-wp-tests.sh wp_cli_test_scaffold {DB_USER} {DB_PASSWORD} {DB_HOST} latest < affirmative-response`
365
+
Then the return code should be 0
366
+
And STDERR should contain:
367
+
"""
368
+
Reinstalling
369
+
"""
370
+
And STDOUT should contain:
371
+
"""
372
+
Recreated the database (wp_cli_test_scaffold)
373
+
"""
374
+
375
+
When I try `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_CORE_DIR={RUN_DIR}/wordpress /usr/bin/env bash {PLUGIN_DIR}/hello-world/bin/install-wp-tests.sh wp_cli_test_scaffold {DB_USER} {DB_PASSWORD} {DB_HOST} latest < negative-response`
376
+
Then the return code should be 0
377
+
And STDERR should contain:
378
+
"""
379
+
Reinstalling
380
+
"""
381
+
And STDOUT should contain:
382
+
"""
383
+
Leaving the existing database (wp_cli_test_scaffold) in place
0 commit comments