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

Declaration of ArraySubset::evaluate incompatible with PHPUnit 7.5 #31101

Closed
okdewit opened this issue Jan 10, 2020 · 7 comments · Fixed by #31113
Closed

Declaration of ArraySubset::evaluate incompatible with PHPUnit 7.5 #31101

okdewit opened this issue Jan 10, 2020 · 7 comments · Fixed by #31113
Labels

Comments

@okdewit
Copy link

okdewit commented Jan 10, 2020

  • Laravel Version: 6.10.1
  • PHP Version: 7.3
  • PHPUnit: 7.5.20

Description:

@GrahamCampbell

I'm getting a very similar issue to #28827 on Laravel 6.10.1 in combination with PHPUnit 7.5.20

ErrorException : Declaration of Illuminate\Foundation\Testing\Constraints\ArraySubset::evaluate($other, string $description = '', bool $returnResult = false) should be compatible with PHPUnit\Framework\Constraint\Constraint::evaluate($other, $description = '', $returnResult = false)

This type signature was not updated in PHPUnit, but it has been changed 11 days ago in Laravel Framework with the release of 6.10.x

https://github.com/sebastianbergmann/phpunit/blob/7.5.20/src/Framework/Constraint/Constraint.php#L47

https://github.com/laravel/framework/blame/02a326ce5641b741fafb017f3d02b8917ba5e563/src/Illuminate/Foundation/Testing/Constraints/ArraySubset.php#L58

@driesvints
Copy link
Member

I think the actual culprit is probably https://github.com/laravel/framework/blame/02a326ce5641b741fafb017f3d02b8917ba5e563/src/Illuminate/Foundation/Testing/Constraints/ArraySubset.php#L193 because the line you highlighted is only used when PHPUnit is installed.

@okdewit
Copy link
Author

okdewit commented Jan 14, 2020

@driesvints If PHPUnit 7.x is not supported on versions higher than Laravel 6.9.0, maybe it's an idea to at least retroactively add that requirement to the Laravel 5.8 > 6 upgrade guide?

@driesvints
Copy link
Member

@okdewit PHPUnit 7 is definitely supported. We're attempting to fix this: #31113

@GrahamCampbell
Copy link
Member

GrahamCampbell commented Jan 16, 2020

#31113 will be merged soon (probably tomorrow), and released as 6.12.0, most likely on Tuesday 21st January. Laravel 7 will drop support for PHPUnit 7.

@GrahamCampbell
Copy link
Member

If PHPUnit 7.x is not supported on versions higher than Laravel 6.9.0, maybe it's an idea to at least retroactively add that requirement to the Laravel 5.8 > 6 upgrade guide?

PHPUnit 7 is supported on Laravel 6. We are treating it as a bug that the latest version of Laravel 6 doesn't support it. A fix will be merged shortly (see my above comment).

@GrahamCampbell
Copy link
Member

GrahamCampbell commented Jan 16, 2020

Supported versions matrix:

Laravel Version PHP 7.0 PHP 7.1 PHP 7.2 PHP 7.3 PHP 7.4 PHP 8.0 PHP Unit 6 PHP Unit 7 PHP Unit 8 PHP Unit 9
5.5 LTS YES YES YES YES NO NO YES NO NO NO
5.8 NO YES YES YES YES NO NO YES YES NO
6.x LTS NO NO YES YES YES YES NO YES YES YES
7.x NO NO YES YES YES YES NO NO YES YES

@GrahamCampbell
Copy link
Member

Note that there may be some breaks with PHP 8.0 and PHPUnit 9.0, but these will be fixed, as we are saying we will support them going forward, since Laravel 6 is LTS.

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

Successfully merging a pull request may close this issue.

3 participants