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 the contents of the /tmp/behat-wordpress/wp-includes/version.php file should match /\-(alpha|beta[0-9]+|RC[0-9]+)\-/
325
+
And the contents of the {RUN_DIR}/wordpress/wp-includes/version.php file should match /\-(alpha|beta[0-9]+|RC[0-9]+)\-/
338
326
And the {PLUGIN_DIR}/hello-world/phpunit.xml.dist file should exist
339
327
And STDERR should contain:
340
328
"""
341
329
install_test_suite
342
330
"""
343
331
344
-
# TODO: Hardcoded for GHA, needs to be made more flexible for local setups.
345
332
# This throws a warning for the password provided via command line.
346
333
When I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "SHOW DATABASES"`
347
334
And STDOUT should contain:
348
335
"""
349
336
wp_cli_test_scaffold
350
337
"""
351
338
352
-
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`
353
340
Then the return code should be 0
354
341
355
-
@require-php-8.0
356
-
Scenario: Install WordPress from trunk for PHP 8.0+
And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress`
377
-
And save STDOUT as {PHPUNIT_PHAR_URL}
378
-
And I run `wget -q -O phpunit {PHPUNIT_PHAR_URL}`
379
-
And I run `chmod +x phpunit`
380
-
And I run `wp plugin path`
381
-
And save STDOUT as {PLUGIN_DIR}
382
-
And I run `wp scaffold plugin hello-world`
383
-
# TODO: Hardcoded for GHA, needs to be made more flexible for local setups.
384
-
# This throws a warning for the password provided via command line.
385
-
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"`
386
-
And I try `rm -fr /tmp/behat-wordpress-tests-lib`
387
-
And I try `rm -fr /tmp/behat-wordpress`
388
-
389
-
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`
390
343
Then the return code should be 0
391
-
And the /tmp/behat-wordpress-tests-lib directory should contain:
392
-
"""
393
-
data
394
-
"""
395
-
And the /tmp/behat-wordpress-tests-lib directory should contain:
396
-
"""
397
-
includes
398
-
"""
399
-
And the /tmp/behat-wordpress-tests-lib directory should contain:
400
-
"""
401
-
wp-tests-config.php
402
-
"""
403
-
And the /tmp/behat-wordpress directory should contain:
404
-
"""
405
-
index.php
406
-
"""
407
-
408
-
# WP 5.0+: js
409
-
410
-
And the /tmp/behat-wordpress directory should contain:
411
-
"""
412
-
license.txt
413
-
readme.html
414
-
"""
415
-
416
-
# WP 5.0+: styles
417
-
418
-
And the /tmp/behat-wordpress directory should contain:
419
-
"""
420
-
wp-activate.php
421
-
wp-admin
422
-
wp-blog-header.php
423
-
wp-comments-post.php
424
-
wp-config-sample.php
425
-
wp-content
426
-
wp-cron.php
427
-
wp-includes
428
-
wp-links-opml.php
429
-
wp-load.php
430
-
wp-login.php
431
-
wp-mail.php
432
-
wp-settings.php
433
-
wp-signup.php
434
-
wp-trackback.php
435
-
xmlrpc.php
436
-
"""
437
-
And the contents of the /tmp/behat-wordpress/wp-includes/version.php file should match /\-(alpha|beta[0-9]+|RC[0-9]+)\-/
438
-
And the {PLUGIN_DIR}/hello-world/phpunit.xml.dist file should exist
439
-
And STDERR should contain:
440
-
"""
441
-
install_test_suite
442
-
"""
443
-
444
-
# TODO: Hardcoded for GHA, needs to be made more flexible for local setups.
445
-
# This throws a warning for the password provided via command line.
446
-
When I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "SHOW DATABASES"`
447
-
And STDOUT should contain:
448
-
"""
449
-
wp_cli_test_scaffold
450
-
"""
451
344
452
-
When I try `WP_TESTS_DIR=/tmp/behat-wordpress-tests-lib ./phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist`
453
-
Then the return code should be 1
454
-
And STDOUT should contain:
455
-
"""
456
-
The scaffolded tests cannot currently be run on PHP 8.0+. See https://github.com/wp-cli/scaffold-command/issues/285
457
-
"""
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
458
347
459
348
Scenario: Install WordPress 3.7 and phpunit will not run
460
349
Given a WP install
461
350
And I run `wp plugin path`
462
351
And save STDOUT as {PLUGIN_DIR}
463
352
And I run `wp scaffold plugin hello-world`
464
-
# TODO: Hardcoded for GHA, needs to be made more flexible for local setups.
465
353
# This throws a warning for the password provided via command line.
466
354
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"`
467
-
And I try `rm -fr /tmp/behat-wordpress-tests-lib`
468
-
And I try `rm -fr /tmp/behat-wordpress`
469
355
470
-
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} 3.7`
356
+
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} 3.7`
471
357
Then the return code should be 0
472
-
And the /tmp/behat-wordpress-tests-lib directory should contain:
358
+
And the {RUN_DIR}/wordpress-tests-lib directory should contain:
473
359
"""
474
360
data
475
361
"""
476
-
And the /tmp/behat-wordpress-tests-lib directory should contain:
362
+
And the {RUN_DIR}/wordpress-tests-lib directory should contain:
477
363
"""
478
364
includes
479
365
"""
480
-
And the /tmp/behat-wordpress-tests-lib directory should contain:
366
+
And the {RUN_DIR}/wordpress-tests-lib directory should contain:
481
367
"""
482
368
wp-tests-config.php
483
369
"""
484
-
And the /tmp/behat-wordpress directory should contain:
370
+
And the {RUN_DIR}/wordpress directory should contain:
0 commit comments