Skip to content

Commit

Permalink
tests: Replace deprecated PHPUnit assertObject(Not)HasAttribute (#3…
Browse files Browse the repository at this point in the history
…3268)

PHPUnit 10 at first removed this but then in 10.1 re-added it as
`assertObject(Not)HasProperty`. Now that a replacement exists,
yoast/phpunit-polyfills provides a polyfill, so let's make use of it.

Note WordPress's `WP_UnitTestCase` and WorDBless's
`WorDBless\BaseTestCase` both already include all Yoast polyfill traits,
so explicit use of the trait is only needed for things using PHPUnit's
base class.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/6302853196
  • Loading branch information
anomiex authored and matticbot committed Sep 25, 2023
1 parent 1cefe44 commit 36db4dc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"require-dev": {
"yoast/phpunit-polyfills": "1.1.0",
"automattic/jetpack-changelogger": "^3.3.9"
"automattic/jetpack-changelogger": "^3.3.10-alpha"
},
"autoload": {
"classmap": [
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

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

2 changes: 1 addition & 1 deletion vendor/automattic/jetpack-device-detection/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"require": {},
"require-dev": {
"yoast/phpunit-polyfills": "1.1.0",
"automattic/jetpack-changelogger": "^3.3.9"
"automattic/jetpack-changelogger": "^3.3.10-alpha"
},
"suggest": {
"automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package."
Expand Down
4 changes: 2 additions & 2 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-device-detection",
"reference": "37d66058763ed1c7d56066b346d986247e1199b4"
"reference": "cc2f185b159961b3bd73e798a43a469d5f09c5b5"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.9",
"automattic/jetpack-changelogger": "^3.3.10-alpha",
"yoast/phpunit-polyfills": "1.1.0"
},
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'automattic/jetpack-device-detection' => array(
'pretty_version' => '1.4.27',
'version' => '1.4.27.0',
'reference' => '37d66058763ed1c7d56066b346d986247e1199b4',
'reference' => 'cc2f185b159961b3bd73e798a43a469d5f09c5b5',
'type' => 'jetpack-library',
'install_path' => __DIR__ . '/../automattic/jetpack-device-detection',
'aliases' => array(),
Expand Down

0 comments on commit 36db4dc

Please sign in to comment.