diff --git a/composer.json b/composer.json index 4c564f5..17c881b 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,8 @@ "wp-coding-standards/wpcs": "^2", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "phpunit/phpunit": "^7", - "phpcompatibility/php-compatibility": "^9.3" + "phpcompatibility/php-compatibility": "^9.3", + "yoast/phpunit-polyfills": "^1.0" }, "scripts": { "lint": "@phpcs", diff --git a/composer.lock b/composer.lock index b0333df..907f432 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "96f944ff852531c8295ad8a80cfdc381", + "content-hash": "2fb3eac834ce14dc32fade3c1f75cef3", "packages": [], "packages-dev": [ { @@ -4530,6 +4530,69 @@ "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" }, "time": "2020-05-13T23:57:56+00:00" + }, + { + "name": "yoast/phpunit-polyfills", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", + "reference": "f014fb21c2b0038fd329515d59025af42fb98715" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/f014fb21c2b0038fd329515d59025af42fb98715", + "reference": "f014fb21c2b0038fd329515d59025af42fb98715", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^0.5", + "php-parallel-lint/php-parallel-lint": "^1.3.0", + "yoast/yoastcs": "^2.1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "autoload": { + "files": [ + "phpunitpolyfills-autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Team Yoast", + "email": "support@yoast.com", + "homepage": "https://yoast.com" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Yoast/PHPUnit-Polyfills/graphs/contributors" + } + ], + "description": "Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests", + "homepage": "https://github.com/Yoast/PHPUnit-Polyfills", + "keywords": [ + "phpunit", + "polyfill", + "testing" + ], + "support": { + "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", + "source": "https://github.com/Yoast/PHPUnit-Polyfills" + }, + "time": "2021-08-09T16:28:08+00:00" } ], "aliases": [], @@ -4541,5 +4604,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.1.0" } diff --git a/package-lock.json b/package-lock.json index 01889dd..9d16e4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -733,9 +733,9 @@ "dev": true }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "path-root": { diff --git a/tests/phpunit/bootstrap.php b/tests/phpunit/bootstrap.php index 55c9ce6..ead560b 100644 --- a/tests/phpunit/bootstrap.php +++ b/tests/phpunit/bootstrap.php @@ -5,6 +5,8 @@ $_tests_dir = '/tmp/wordpress-tests-lib'; } +define( 'WP_TESTS_PHPUNIT_POLYFILLS_PATH', __DIR__ . '/../../vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php' ); + require_once $_tests_dir . '/includes/functions.php'; if ( getenv( 'WP_CORE_DIR' ) ) {