Skip to content

Commit

Permalink
Add PHPUnit Polyfills for trunk compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Aug 16, 2021
1 parent 35ea151 commit e7e908f
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 2 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"phpcompatibility/php-compatibility": "^9.3",
"symfony/filesystem": "^5",
"symfony/service-contracts": "^2",
"symfony/translation-contracts": "^2"
"symfony/translation-contracts": "^2",
"yoast/phpunit-polyfills": "^1.0"
},
"scripts": {
"lint": "@phpcs",
Expand Down
65 changes: 64 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tests/phpunit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
$_tests_dir = '/tmp/wordpress-tests-lib';
}

define( 'WP_TESTS_PHPUNIT_POLYFILLS_PATH', __DIR__ . '/../../vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php' );

// Give access to tests_add_filter() function.
require_once $_tests_dir . '/includes/functions.php';

Expand Down

0 comments on commit e7e908f

Please sign in to comment.