Skip to content

[PhpUnitBridge] Add polyfill for PhpUnit namespace #32940

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 5, 2019

Conversation

jderusse
Copy link
Member

@jderusse jderusse commented Aug 5, 2019

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

This PR provides PhpUnit >= 6 Namespaces class.

This will simplify tests that have to be compatible with multiple version of PHPUnit

- if (class_exists('PHPUnit_Foo')) {
-   PHPUnit_Foo::bar():
- } else {
-   \PHPUnit\Foo::bar();
- }
+ \PHPUnit\Foo::bar();

WIP => waiting for #32941 to be green

@jderusse jderusse force-pushed the polyfill_namespace branch from acd1df1 to 04d1b2d Compare August 5, 2019 12:22
@jderusse jderusse changed the title WIP [PhpUnitBridge] Add polyfill for PhpUnit namespace [PhpUnitBridge] Add polyfill for PhpUnit namespace Aug 5, 2019
@jderusse jderusse force-pushed the polyfill_namespace branch from 04d1b2d to b7520f7 Compare August 5, 2019 13:03
@nicolas-grekas
Copy link
Member

Thank you @jderusse.

@nicolas-grekas nicolas-grekas added this to the next milestone Aug 5, 2019
@nicolas-grekas nicolas-grekas merged commit b7520f7 into symfony:4.4 Aug 5, 2019
nicolas-grekas added a commit that referenced this pull request Aug 5, 2019
…erusse)

This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Add polyfill for PhpUnit namespace

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

This PR provides PhpUnit >= 6 Namespaces class.

This will simplify tests that have to be compatible with multiple version of PHPUnit

```diff
- if (class_exists('PHPUnit_Foo')) {
-   PHPUnit_Foo::bar():
- } else {
-   \PHPUnit\Foo::bar();
- }
+ \PHPUnit\Foo::bar();
```

WIP  => waiting for #32941 to be green

Commits
-------

b7520f7 Add polyfill for PhpUnit namespace
nicolas-grekas added a commit that referenced this pull request Aug 5, 2019
This PR was squashed before being merged into the 3.4 branch (closes #32941).

Discussion
----------

Use namespaced Phpunit classes

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

This PR simplify tests by using PhpUnit namespace introduced in #32940
It also makes compatible with PHPUnit 8 (removed class PHPUnit_Framework_MockObject_MockObject)

Commits
-------

797ea2e Use namespaced Phpunit classes
@jderusse jderusse deleted the polyfill_namespace branch August 8, 2019 11:37
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
This was referenced Nov 12, 2019
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.

4 participants