Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 886a28c

Browse files
bug #21186 [Bridge/PhpUnit] Relax expectedDeprecation for forward compat (nicolas-grekas)
This PR was merged into the 3.2 branch. Discussion ---------- [Bridge/PhpUnit] Relax expectedDeprecation for forward compat | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Instead of a strict match, this makes the annotation check ignore not expected messages, while still requiring all the expected ones in order. This is needed for forward compat with future deprecations, and should make travis green again. Commits ------- a3ba726 [Bridge/PhpUnit] Relax expectedDeprecation for forward compat
2 parents 0f93fac + a3ba726 commit 886a28c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ public function endTest(\PHPUnit_Framework_Test $test, $time)
179179

180180
if (!in_array($test->getStatus(), array(\PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED, \PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE, \PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE, \PHPUnit_Runner_BaseTestRunner::STATUS_ERROR), true)) {
181181
try {
182-
$prefix = "@expectedDeprecation:\n ";
183-
$test->assertStringMatchesFormat($prefix.implode("\n ", $this->expectedDeprecations), $prefix.implode("\n ", $this->gatheredDeprecations));
182+
$prefix = "@expectedDeprecation:\n";
183+
$test->assertStringMatchesFormat($prefix.'%A '.implode("\n%A ", $this->expectedDeprecations)."\n%A", $prefix.' '.implode("\n ", $this->gatheredDeprecations)."\n");
184184
} catch (\PHPUnit_Framework_AssertionFailedError $e) {
185185
$test->getTestResultObject()->addFailure($test, $e, $time);
186186
}

0 commit comments

Comments
 (0)