Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use PHPUnit 9.3 on php 8#37771

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:3.4fromderrabus:bugfix/phpunit-9.3-on-php-8
Aug 12, 2020

Conversation

@derrabus
Copy link
Member

QA
Branch?3.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsPart of#37564
LicenseMIT
Doc PRN/A

Our CI for PHP 8 is currently a blind spot, mainly because the PHPUnit version 8.3 that we use for the test suite is incompatible with php 8. This PR changes the PHPUnit version used on Travis for php 8 to PHPUnit 9.3.

Our test suite might not be 100% compatible with that new PHPUnit release yet, but this change should allow us to run most tests on php 8 again and enable us to iteratively migrate to PHPUnit 9.3.

@derrabus
Copy link
MemberAuthor

I'm browsing through all failures on the php 8 run at the moment and see if I can fix or file separate issues for them.

@derrabusderrabusforce-pushed thebugfix/phpunit-9.3-on-php-8 branch fromd1ffb3c tod642d85CompareAugust 10, 2020 08:16
@stof
Copy link
Member

Errors related to PHPUnit 9.3:

  • TestCase::at() is deprecated. We would need to migrate away from it (the replacement is compatible with older PHPUnit versions, so this can be done separately)
  • the PHPUnit bridge is not compatible, due to trying to usePHPUnit\TextUI\Exception
  • assertDirectoryNotExists is deprecated in favor ofassertDirectoryDoesNotExist. the bridge might provide a polyfill for the new method for older PHPUnit versions.
  • Support for using expectException() with PHPUnit\Framework\Error\Warning is deprecated and will be removed in PHPUnit 10. Use expectWarning() instead.

Errors related to PHP 8:

  • doctrine/annotations is currently broken due to changes in the tokens for namespaces. This is being worked on in Doctrine so this will be solved.
  • Symfony\Component\Cache\Tests\Adapter\MemcachedAdapterTest andSymfony\Component\Cache\Tests\Simple\MemcachedCacheTextModeTest fail because the exception message for undefined class constants changed.
  • Symfony\Component\ExpressionLanguage\Tests\Node\GetAttrNodeTest::testEvaluate fails because of an incompatibility with named arguments (probably usingcall_user_fun_array with an associative array)
  • Symfony\Component\Filesystem\Tests\FilesystemTest fails with a TypeError on wrong mode. The tests should probably be skipped.
  • Symfony\Component\Yaml\Tests\DumperTest::testSpecifications has a failure

@derrabus
Copy link
MemberAuthor

Thanks for the overview. I can look into the individual issues in the upcoming days, but nevertheless I think that we can merge this PR already. It improves the php 8 CI from "completely broken" to "just a little broken". 😃

A few notes:

TestCase::at() is deprecated.

➡️#37780

assertDirectoryNotExists is deprecated in favor ofassertDirectoryDoesNotExist. the bridge might provide a polyfill for the new method for older PHPUnit versions.

It does already:

publicstaticfunctionassertDirectoryDoesNotExist($directory,$message ='')
{
static::assertDirectoryNotExists($directory,$message);
}

@stof
Copy link
Member

It does already:

then that's even easier. We can migrate to use the new method everywhere.

But this polyfill is weird. It never calls the parent implementation.

@derrabus
Copy link
MemberAuthor

But this polyfill is weird. It never calls the parent implementation.

That's because PhpUnitBridge patches the trait directly into theTestCase class.

@derrabus
Copy link
MemberAuthor

Also related to php 8: We still see the messageMethod ReflectionParameter::getClass() is deprecated frequently. As far as I can tell, we would need to backport#36975 to the 3.4 branch if we wanted to fix them.

@fabpot
Copy link
Member

Thank you@derrabus.

@fabpotfabpot merged commit78cc0ef intosymfony:3.4Aug 12, 2020
@stof
Copy link
Member

stof commentedAug 12, 2020
edited
Loading

  • doctrine/annotations is currently broken due to changes in the tokens for namespaces. This is being worked on in Doctrine so this will be solved.

for reference, this is now solved.

@derrabusderrabus deleted the bugfix/phpunit-9.3-on-php-8 branchAugust 12, 2020 18:11
This was referencedAug 31, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@stofstofstof approved these changes

@xabbuhxabbuhxabbuh approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@derrabus@stof@fabpot@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp