From e0686fe4a48c3405a253634649b25fd4c90344b2 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 23 Sep 2023 04:17:30 +0200 Subject: [PATCH] Composer/Tests: update test dependencies This updates the minimum version of the WP Test Utils dependency. This also allows us to remove the work-around which was in place for Mockery not handling dynamic properties on mocked objects. This was fixed in Mockery 1.6.0, which will be used when running the tests against PHP 8.2+. Note: PHPUnit Polyfills 1.1.0 includes a new polyfill for the `assertObject[Not]HasProperty()` methods. The assertions which these new assertions replace are not used in this test suite, so no test changes are needed. --- composer.json | 2 +- tests/unit/bootstrap.php | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 7b200dc6f..b963f7776 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "require-dev": { "yoast/yoastcs": "^2.3.1", - "yoast/wp-test-utils": "^1.1.1", + "yoast/wp-test-utils": "^1.2.0", "roave/security-advisories": "dev-master" }, "autoload": { diff --git a/tests/unit/bootstrap.php b/tests/unit/bootstrap.php index be2fb093a..7bd3fe8b5 100644 --- a/tests/unit/bootstrap.php +++ b/tests/unit/bootstrap.php @@ -19,16 +19,3 @@ require_once __DIR__ . '/../../vendor/yoast/wp-test-utils/src/BrainMonkey/bootstrap.php'; require_once __DIR__ . '/../../vendor/autoload.php'; - -// Create the necessary test doubles for WP native classes on which properties are being set. -Yoast\WPTestUtils\BrainMonkey\makeDoublesForUnavailableClasses( - [ - 'WP_Post', - 'WP_Post_Type', - 'WP_Role', - 'WP_Screen', - 'WP_Taxonomy', - 'WP_Term', - 'WP_User', - ] -);