Skip to content

Commit

Permalink
bug #38679 [PhpUnitBridge] Add missing exporter function for PHPUnit …
Browse files Browse the repository at this point in the history
…7 (alcaeus)

This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Add missing exporter function for PHPUnit 7

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License       | MIT

This adds a missing `exporter` function to the compatibility trait for PHPUnit constraints. This method is still required for PhpUnit 7.

Commits
-------

52e7d78 Add missing exporter function for PHPUnit 7
  • Loading branch information
derrabus committed Oct 22, 2020
2 parents 5a4be68 + 52e7d78 commit e5faa29
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Symfony/Bridge/PhpUnit/Legacy/ConstraintTraitForV7.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace Symfony\Bridge\PhpUnit\Legacy;

use SebastianBergmann\Exporter\Exporter;

/**
* @internal
*/
Expand All @@ -31,6 +33,15 @@ protected function additionalFailureDescription($other): string
return $this->doAdditionalFailureDescription($other);
}

protected function exporter(): Exporter
{
if (null !== $this->exporter) {
$this->exporter = new Exporter();
}

return $this->exporter;
}

protected function failureDescription($other): string
{
return $this->doFailureDescription($other);
Expand Down

0 comments on commit e5faa29

Please sign in to comment.