8000 feature #21828 [PhpUnitBridge] include expected deprecations in asser… · symfony/symfony@18315b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 18315b4

Browse files
feature #21828 [PhpUnitBridge] include expected deprecations in assertion counter (xabbuh)
This PR was merged into the 3.3-dev branch. Discussion ---------- [PhpUnitBridge] include expected deprecations in assertion counter | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #21786 (comment) | License | MIT | Doc PR | We still need to include the changes from #21786 as we cannot increment the number of assertions in the `startTest()` method (the PHPUnit test runner resets the counter after the listeners have been executed). Commits ------- cdcd5ae include expected deprecations in assertion counter
2 parents 0413e18 + cdcd5ae commit 18315b4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ public function endTest($test, $time)
246246
}
247247

248248
if ($this->expectedDeprecations) {
249+
if (!in_array($test->getStatus(), array($BaseTestRunner::STATUS_SKIPPED, $BaseTestRunner::STATUS_INCOMPLETE), true)) {
250+
$test->addToAssertionCount(count($this->expectedDeprecations));
251+
}
252+
249253
restore_error_handler();
250254

251255
if (!in_array($test->getStatus(), array($BaseTestRunner::STATUS_SKIPPED, $BaseTestRunner::STATUS_INCOMPLETE, $BaseTestRunner::STATUS_FAILURE, $BaseTestRunner::STATUS_ERROR), true)) {

0 commit comments

Comments
 (0)
0