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: Raise phpunit to v8.1 #1565

Merged
merged 8 commits into from May 13, 2019
Merged

Conversation

johannessteu
Copy link
Contributor

@johannessteu johannessteu commented Apr 28, 2019

This change raises the phpunit requirement to v8.1. This might be breaking for you as phpunit introduced return types on methods like public setUp(): void as well as public tearDown(): void. PHPUnit also deprecated a lot of methods. You might find here some more background information about replacements for your assertions.

Resolves #1506

@johannessteu
Copy link
Contributor Author

For Unit-Tests i'm down to this:

WARNINGS!
Tests: 4845, Assertions: 9410, Warnings: 16, Skipped: 52.

Some warnings are left regarding sebastianbergmann/phpunit#3338.
But I'm actually not sure right now how to fix those. At some places we might be able to use ObjectAccess.

There were 16 warnings:

1) Neos\Flow\Tests\Unit\Http\BrowserTest::browserFollowsRedirectionIfResponseTellsSo
attributeEqualTo() is deprecated and will be removed in PHPUnit 9.
attribute() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

2) Neos\Flow\Tests\Unit\I18n\Cldr\CldrRepositoryTest::modelIsReturnedCorrectlyForSingleFile
assertAttributeContains() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

3) Neos\Flow\Tests\Unit\I18n\Cldr\CldrRepositoryTest::modelIsReturnedCorrectlyForGroupOfFiles
assertAttributeContains() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.
[...]

@johannessteu
Copy link
Contributor Author

johannessteu commented Apr 28, 2019

To make travis run with phpunit 8.1 we need this one merged
neos/flow-development-distribution#38

@kdambekalns kdambekalns self-requested a review April 29, 2019 06:59
@johannessteu
Copy link
Contributor Author

Open tasks Unit-Tests:

  • Adjust composer.json dependencies
  • Refactor deprecated @expectedException annotation
  • Refactor to use assertEqualsWithDelta()
  • Refactor to use assertStringContainsString()
  • Adjust other warnings for deprecated code
  • Double check that travis is acutally running phpunit v8

Open tasks Functional-Tests:

  • Adjust composer.json dependencies
  • Refactor deprecated @expectedException annotation
  • Refactor to use assertEqualsWithDelta()
  • Refactor to use assertStringContainsString()
  • Adjust other warnings for deprecated code
  • Double check that travis is acutally running phpunit v8

Copy link
Member

@daniellienert daniellienert left a comment

Choose a reason for hiding this comment

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

Looks good and tests are working

@daniellienert daniellienert merged commit 4de58f3 into neos:master May 13, 2019
Neos 5.0 & Flow 6.0 Release Board automation moved this from Needs review to Done May 13, 2019
@johannessteu johannessteu deleted the phpunit-8 branch May 13, 2019 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

The next major should ship phpunit v8.0 support
2 participants