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

Appearance settings

[PhpUnitBridge] install PHPUnit 6 on PHP 7.2 #23952

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

Merged
merged 1 commit into from
Aug 28, 2017
Merged

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Aug 22, 2017

Q A
Branch? 3.4
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #23943
License MIT
Doc PR

@dmaicher
Copy link
Contributor

dmaicher commented Aug 22, 2017

As phpunit 6 itself is not really backwards compatible due to the namespace changes: does the phpunit bridge add any backwards compat layer for it? Or will my tests just fail if my testsuite is running on phpunit 5 currently (with php 7.2) without using any namespaced phpunit base classes?

@xabbuh xabbuh changed the base branch from master to 3.4 August 22, 2017 17:04
$PHPUNIT_VERSION = getenv('SYMFONY_PHPUNIT_VERSION') ?: '5.7';
} else {
// PHPUnit 5.1 requires PHP 5.6+
$PHPUNIT_VERSION = getenv('SYMFONY_PHPUNIT_VERSION') ?: '4.8';
Copy link
Member

Choose a reason for hiding this comment

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

This changes the existing behavior. For PHP < 5.6, the env variable was ignored before, forcing to use 4.8, as this is the only usable version there:

  • newer versions are not supported on these PHP runtimes
  • older versions than 4.8 are not supported by the bridge.

I would keep this behavior (anyway, changing it is a BC break).

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right. I misread the nested ternary operators.

@stof
Copy link
Member

stof commented Aug 22, 2017

@dmaicher if you run your testsuite on PHPUnit 6 while using PHPUnit_Framework_TestCase as base class, things will break totally.
However, using the PHPUnit bridge with PHPUnit 5.7 on PHP 7.2 will also make your CI red: the bridge makes the run fail when encountering deprecations, and PHPUnit 5.7 triggers a deprecation coming from PHP 7.2.

However, making your testsuite compatible with several PHPUnit versions is possible. PHPUnit 4.8.35 and 5.4.3+ are providing the PHPUnit\Framework\TestCase class as a forward compatibility layer, allowing you to migrate to the namespace API in your extends clause. This is the way to go.
And note that PHPUnit 6 is the only actively maintained version of PHPUnit, so migrating to it is a must-have IMO.
And the migration to namespaced base testcase can be done easily. If you don't care about getting extends \PHPUnit\Framework\TestCase instead of using a use statement, it is a simple search&replace.

@Simperfit
Copy link
Contributor

Simperfit commented Aug 24, 2017

Maybe it will help for #23671. 👍 but there will be some work to do.

@fabpot
Copy link
Member

fabpot commented Aug 24, 2017

I think this should be merged in 3.3 instead.

@nicolas-grekas
Copy link
Member

👍 for 3.3

@xabbuh xabbuh changed the base branch from 3.4 to 3.3 August 28, 2017 10:42
@xabbuh
Copy link
Member Author

xabbuh commented Aug 28, 2017

rebased on 3.3

@xabbuh xabbuh modified the milestones: 3.3, 3.4 Aug 28, 2017
@fabpot
Copy link
Member

fabpot commented Aug 28, 2017

Thank you @xabbuh.

@fabpot fabpot merged commit 30336ea into symfony:3.3 Aug 28, 2017
fabpot added a commit that referenced this pull request Aug 28, 2017
This PR was merged into the 3.3 branch.

Discussion
----------

[PhpUnitBridge] install PHPUnit 6 on PHP 7.2

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23943
| License       | MIT
| Doc PR        |

Commits
-------

30336ea install PHPUnit 6 on PHP 7.2
@@ -1,6 +1,11 @@
CHANGELOG
=========

3.4.0
Copy link
Member

Choose a reason for hiding this comment

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

removed after the merge (2230e31)

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks

@xabbuh xabbuh deleted the issue-23943 branch August 28, 2017 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.