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

Feature/PHP8 #1068

Merged
merged 21 commits into from
Feb 10, 2023
Merged

Feature/PHP8 #1068

merged 21 commits into from
Feb 10, 2023

Conversation

npotier
Copy link
Collaborator

@npotier npotier commented Jan 19, 2022

Work in Progress

The code has been refactored using rector. PHPUnit has been upgraded, and the tests has been partially rewritten in order to comply with this new version.

Test are failing when some MongoDB classes declared as final are mocked:

example :

$ php vendor/bin/phpunit
...
196) APY\DataGridBundle\Grid\Tests\Source\DocumentTest::testGetTotalCountWithMaxResults
PHPUnit\Framework\MockObject\ClassIsFinalException: Class "MongoDB\Driver\Cursor" is declared "final" and cannot be doubled

/Users/nicolaspotier/www/APYDataGridBundle/Tests/Grid/Source/DocumentTest.php:1157
/Users/nicolaspotier/www/APYDataGridBundle/Tests/Grid/Source/DocumentTest.php:1022
/Users/nicolaspotier/www/APYDataGridBundle/Tests/Grid/Source/DocumentTest.php:898

I've tried to use https://github.com/dg/bypass-finals, but without success.

if you have any idea on how to bypass this issue, feel free to tell it here. Otherwise, it might be necessary to rewrite the logic of the test.

@Hanmac
Copy link
Contributor

Hanmac commented Mar 15, 2022

@npotier this user did get the hook working

northernco/NorthernDatagridBundle@925e9af

@fkrauthan
Copy link

Looks good. Any progress on getting PHP 8.x compatibility? I recently upgraded another project (that is not using this bundle) and was gonna tackle my project that is using this bundle next.

@npotier
Copy link
Collaborator Author

npotier commented Feb 10, 2023

Hello, updates from this MR:

I have rewritten all the tests in order to make them works with new version of PHPUnit.
I also have added a Github Action that launches the tests.

I will release this version as a beta for a while and then, if the feedbacks are good, release it as a new version

@npotier npotier changed the title [WIP] Feature/php8 Feature/PHP8 Feb 10, 2023
@npotier npotier merged commit 20655ca into master Feb 10, 2023
@npotier
Copy link
Collaborator Author

npotier commented Feb 10, 2023

OK. It is merged on master and tagged as 5.0.0-beta 🤞

@romainguerrero romainguerrero deleted the feature/php8 branch July 5, 2023 13:33
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

Successfully merging this pull request may close these issues.

3 participants