Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests fail on PHP 8.1 and above #264

Closed
leewillis77 opened this issue Oct 14, 2024 · 1 comment
Closed

Unit tests fail on PHP 8.1 and above #264

leewillis77 opened this issue Oct 14, 2024 · 1 comment

Comments

@leewillis77
Copy link

Not sure what the issue is here exactly, but the unit tests (for the 4.x branch) currently fail on PHP 8.1 or higher:

PHP 8.0

PHPUnit 8.5.40 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.0.30
Configuration: /Users/lee/git_repos/container/phpunit.xml
Error:         This version of PHPUnit does not support code coverage on PHP 8

................................................................. 65 / 72 ( 90%)
.......                                                           72 / 72 (100%)

Time: 59 ms, Memory: 6.00 MB

OK (72 tests, 182 assertions)

PHP 8.1

PHPUnit 8.5.40 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.1.30
Configuration: /Users/lee/git_repos/container/phpunit.xml
Error:         This version of PHPUnit does not support code coverage on PHP 8

..E.F............................................................ 65 / 72 ( 90%)
.......                                                           72 / 72 (100%)

Time: 65 ms, Memory: 6.00 MB

There was 1 error:

1) League\Container\Test\Argument\ArgumentResolverTest::testResolverResolvesArgumentsViaReflection
Error: Call to undefined method ReflectionUnionType::getName()

/Users/lee/git_repos/container/tests/Argument/ArgumentResolverTest.php:81

--

There was 1 failure:

1) League\Container\Test\Argument\ArgumentResolverTest::testResolverThrowsExceptionWhenReflectionDoesNotResolve
Failed asserting that exception of type "Error" matches expected exception "Psr\Container\NotFoundExceptionInterface". Message was: "Call to undefined method ReflectionUnionType::getName()" at
/Users/lee/git_repos/container/tests/Argument/ArgumentResolverTest.php:134
@philipobenito
Copy link
Member

It's a change in the reflection API, while it isn't ideal, there is some funkery going on in the CI pipeline to make it okay. This will be solved properly in the next major release though as it drops support for old versions of PHP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants