APYDataGridBundle icon indicating copy to clipboard operation
APYDataGridBundle copied to clipboard

[WIP] Feature/php8

Open npotier opened this issue 3 years ago • 2 comments

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.

npotier avatar Jan 19 '22 22:01 npotier

@npotier this user did get the hook working

https://github.com/northernco/NorthernDatagridBundle/commit/925e9af5b018965c31bf6c1a30ba34f014246aeb

Hanmac avatar Mar 15 '22 10:03 Hanmac

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.

fkrauthan avatar Mar 31 '22 19:03 fkrauthan

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 avatar Feb 10 '23 20:02 npotier

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

npotier avatar Feb 10 '23 21:02 npotier