Commit Graph

9 Commits

Author SHA1 Message Date
jrfnl 096b24646e
PHP 8.5 | Tests: prevent deprecation notice for Reflection*::setAccessible()
Since PHP 8.1, calling the `Reflection*::setAccessible()` methods is no longer necessary as reflected properties/methods/etc will always be accessible.
However, the method calls are still needed for PHP < 8.1.

As of PHP 8.5, calling the `Reflection*::setAccessible()` methods is now formally deprecated and will yield a deprecation notice, which will fail test runs.
As of PHP 9.0, the `setAccessible()` method(s) will be removed.

With the latter in mind, this commit prevents the deprecation notice by making the calls to `setAccessible()` conditional.

Silencing the deprecation would mean, this would need to be "fixed" again come PHP 9.0, while the current solution should be stable, including for PHP 9.0.

Ref: https://wiki.php.net/rfc/deprecations_php_8_5#extreflection_deprecations
2025-08-10 05:38:47 +02:00
Marcus Bointon dfa731a087
Check broken links, update for HTTPS everywhere 2024-04-01 20:48:10 +02:00
Marcus Bointon 3525f1b6da
Give up on that test config 2022-02-28 16:03:27 +01:00
Marcus Bointon 70c20c6324
Rearrange tests to deal with version issues 2022-02-28 15:48:25 +01:00
Marcus Bointon 03649a2ffb
CS 2022-02-28 15:11:05 +01:00
Marcus Bointon ec421d0680
CS 2022-02-28 15:09:27 +01:00
Marcus Bointon d8002e5482
Add simple OAuthTokenProvider tests 2022-02-28 15:06:17 +01:00
jrfnl d5a5ad19cd CS: minor cleanup
PHPCS 3.6.2 added a sniff for a PSR-12 rule which was previously not strictly checked: "No blank line after the opening brace of a class".

This fixes the newly flagged issues.
2021-12-18 04:08:22 +01:00
Juliette a4e3c130ae
Tests: move OAuth test to own file (#2383)
* Tests/reorganize: move OAuth test to own file

This test uses the `Yoast\PHPUnitPolyfills\TestCases\TestCase` instead of the `PHPMailer\Test\TestCase` base class as it doesn't need the `set_up()` or `tear_down()` methods from the PHPMailer base test class.

* OAuthTest: various test tweaks

Minor test tweaks:
* Add `@covers` tags.
* Add "failure" messages to assertions.
* Minor comment punctuation.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-24 19:19:36 +02:00