Skip to content

Commit

Permalink
bug #33253 Fix missing exporter in PHPUnit constraint poylfill (alcaeus)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.4 branch.

Discussion
----------

Fix missing exporter in PHPUnit constraint poylfill

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | -

Since PHPUnit 7 drops the constructor in `PHPUnit\Framework\Constraint\Constraint`, overriding the constructor in a user land constraint breaks. To do so, we create an exporter in `exporter()` as is done in PHPUnit > 7.

Commits
-------

b78c5cb Fix missing exporter in PHPUnit constraint poylfill
  • Loading branch information
nicolas-grekas committed Aug 20, 2019
2 parents 0e7bf6f + b78c5cb commit e132c42
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Symfony/Bridge/PhpUnit/Legacy/ConstraintTraitForV6.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ protected function additionalFailureDescription($other)
*/
protected function exporter()
{
if (null === $this->exporter) {
$this->exporter = new Exporter();
}

return $this->exporter;
}

Expand Down

0 comments on commit e132c42

Please sign in to comment.