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

Add phpunit 9 support (to allow testing on PHP 8) #14885

Merged
merged 4 commits into from
Aug 15, 2020
Merged

Add phpunit 9 support (to allow testing on PHP 8) #14885

merged 4 commits into from
Aug 15, 2020

Conversation

ADmad
Copy link
Member

@ADmad ADmad commented Aug 8, 2020

No description provided.

@ADmad ADmad added this to the 4.2.0 milestone Aug 8, 2020
@ADmad ADmad changed the base branch from master to 4.next August 8, 2020 07:41
@othercorey
Copy link
Member

3) Cake\Test\TestCase\Database\Type\DateTypeTest::testMarshal with data set #9 ('2014-02-14', Cake\Chronos\Date Object (...))
Failed asserting that two DateTime objects are equal.
--- Expected
+++ Actual
@@ @@
-2014-02-14T00:00:00.000000+0000
+2014-02-14T07:42:50.000000+0000

This looks like a fun failure.

@ADmad
Copy link
Member Author

ADmad commented Aug 8, 2020

Errors on PHP 8:

@ADmad
Copy link
Member Author

ADmad commented Aug 8, 2020

Last commit to Aura.Intl was on Jan 20, 2017. Even running it's test suite with a recent phpunit version would be non trivial. I think it would be better if we just copy the classes we need and move on.

@othercorey
Copy link
Member

I couldn't find any info regarding this. I tried replacing it with openssl_pkey_free() which is apparently it's alias but that function too gives deprecation error. So nothing sure if there's some alternative or we just need to drop it's usage for PHP 8.

The openssl_pkey_free() function is deprecated and no longer has an effect,
instead the OpenSSLAsymmetricKey instance is automatically destroyed if it is no
longer referenced.

https://github.com/php/php-src/blob/master/UPGRADING#L397

@ADmad
Copy link
Member Author

ADmad commented Aug 8, 2020

https://github.com/php/php-src/blob/master/UPGRADING#L397

Good, so just need to wrap the call in a PHP version check.

@othercorey
Copy link
Member

We can commit this with failures allowed so people can test fixes or will have to wait work on them here.

@ADmad
Copy link
Member Author

ADmad commented Aug 8, 2020

Once #14885 is merged and forwarded to 4.next the build on PHP 8 will start passing so there's no need to modify the travis matrix.

@ADmad ADmad force-pushed the phpunit-9 branch 11 times, most recently from 5d255e4 to 2a194c2 Compare August 15, 2020 08:48
.travis.yml Outdated Show resolved Hide resolved
Copy link
Member

@othercorey othercorey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok to me.

@ADmad
Copy link
Member Author

ADmad commented Aug 15, 2020

This is ready to merge now.

The only remaining failure for DateTimeType marshalling needs a fix in Chronos (which isn't an easy fix) and dealing with the warnings for usage of at() for mocks will take significant amount of effort given the number of usages. Perhaps this would be a good time to start switching to Mockery instead.

This allows our testsuite to be used with PHP 8.5+ & 9+ without
deprecation warnings.
…asted to float.

The check behaves different in PHP 8 causing test failures.
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.

None yet

4 participants