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
When I run `WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib ./phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist`
339
+
When I run `composer init --no-interaction --quiet --name=wp-cli/test-scenario --require="yoast/phpunit-polyfills=^1.0.1" --working-dir={RUN_DIR}/wordpress-tests-lib`
347
340
Then the return code should be 0
348
341
349
-
@require-php-8.0
350
-
Scenario: Install WordPress from trunk for PHP 8.0+
And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress`
371
-
And save STDOUT as {PHPUNIT_PHAR_URL}
372
-
And I run `wget -q -O phpunit {PHPUNIT_PHAR_URL}`
373
-
And I run `chmod +x phpunit`
374
-
And I run `wp plugin path`
375
-
And save STDOUT as {PLUGIN_DIR}
376
-
And I run `wp scaffold plugin hello-world`
377
-
# This throws a warning for the password provided via command line.
378
-
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"`
379
-
And I try `rm -fr /tmp/behat-wordpress-tests-lib`
380
-
And I try `rm -fr /tmp/behat-wordpress`
381
-
382
-
When I try `WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib WP_CORE_DIR=/tmp/behat-wordpress /usr/bin/env bash {PLUGIN_DIR}/hello-world/bin/install-wp-tests.sh wp_cli_test_scaffold {DB_USER} {DB_PASSWORD} {DB_HOST} trunk`
342
+
When I run `composer install --no-interaction --quiet --working-dir={RUN_DIR}/wordpress-tests-lib`
383
343
Then the return code should be 0
384
-
And the /tmp/behat-wordpress-tests-lib directory should contain:
385
-
"""
386
-
data
387
-
"""
388
-
And the /tmp/behat-wordpress-tests-lib directory should contain:
389
-
"""
390
-
includes
391
-
"""
392
-
And the /tmp/behat-wordpress-tests-lib directory should contain:
393
-
"""
394
-
wp-tests-config.php
395
-
"""
396
-
And the /tmp/behat-wordpress directory should contain:
397
-
"""
398
-
index.php
399
-
"""
400
-
401
-
# WP 5.0+: js
402
344
403
-
And the /tmp/behat-wordpress directory should contain:
404
-
"""
405
-
license.txt
406
-
readme.html
407
-
"""
408
-
409
-
# WP 5.0+: styles
410
-
411
-
And the /tmp/behat-wordpress directory should contain:
412
-
"""
413
-
wp-activate.php
414
-
wp-admin
415
-
wp-blog-header.php
416
-
wp-comments-post.php
417
-
wp-config-sample.php
418
-
wp-content
419
-
wp-cron.php
420
-
wp-includes
421
-
wp-links-opml.php
422
-
wp-load.php
423
-
wp-login.php
424
-
wp-mail.php
425
-
wp-settings.php
426
-
wp-signup.php
427
-
wp-trackback.php
428
-
xmlrpc.php
429
-
"""
430
-
And the contents of the /tmp/behat-wordpress/wp-includes/version.php file should match /\-(alpha|beta[0-9]+|RC[0-9]+)\-/
431
-
And the {PLUGIN_DIR}/hello-world/phpunit.xml.dist file should exist
432
-
And STDERR should contain:
433
-
"""
434
-
install_test_suite
435
-
"""
436
-
437
-
# This throws a warning for the password provided via command line.
438
-
When I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "SHOW DATABASES"`
439
-
And STDOUT should contain:
440
-
"""
441
-
wp_cli_test_scaffold
442
-
"""
443
-
444
-
When I try `WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib ./phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist`
445
-
Then the return code should be 1
446
-
And STDOUT should contain:
447
-
"""
448
-
The scaffolded tests cannot currently be run on PHP 8.0+. See https://github.com/wp-cli/scaffold-command/issues/285
449
-
"""
345
+
When I run `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_TESTS_PHPUNIT_POLYFILLS_PATH={RUN_DIR}/wordpress-tests-lib/vendor/yoast/phpunit-polyfills ./phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist`
346
+
Then the return code should be 0
450
347
451
348
Scenario: Install WordPress 3.7 and phpunit will not run
0 commit comments