upgrade to phpunit 8+
- Dominant language
- PHP
- Stars
- 29
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
I tried, it just requires this small fix:
```diff
--- a/tests/SpTest.php
+++ b/tests/SpTest.php
@@ -479,7 +479,7 @@ final class SpTest extends PHPUnit\Framework\TestCase
}
}
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass() : void
{
unlink(self::$settings['sp_key_file']);
unlink(self::$settings['sp_cert_file']);
```
but I got many warnings similar to:
```
⚠ Can load from valid x m l
│
│ assertAttributeNotEmpty() is deprecated and will be removed in PHPUnit 9.
│ readAttribute() is deprecated and will be removed in PHPUnit 9.
│ getObjectAttribute() is deprecated and will be removed in PHPUnit 9.
```
these are related to: https://github.com/sebastianbergmann/phpunit/issues/3338
rationale:
> A test should not depend on private implementation details. It was a bad idea to make a bad testing practice this convenient.
upgrade path suggested by the creator of PHPUnit:
> The upgrade path is to refactor your (test) code to not require the assertions in question.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with tests/SpTest.php and the deprecated assertions reported when running the test suite under PHPUnit 8+. Review the PHPUnit 3338 upgrade guidance and identify each use of private-attribute assertions or attribute access. Done means the tests run on PHPUnit 8+ without the reported deprecation warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100