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 | https://github.com/symfony/symfony/pull/21786#issuecomment-283074426
| 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
This commit is contained in:
Nicolas Grekas 2017-03-02 13:15:41 +01:00
commit 18315b4922

View File

@ -246,6 +246,10 @@ class SymfonyTestsListenerTrait
}
if ($this->expectedDeprecations) {
if (!in_array($test->getStatus(), array($BaseTestRunner::STATUS_SKIPPED, $BaseTestRunner::STATUS_INCOMPLETE), true)) {
$test->addToAssertionCount(count($this->expectedDeprecations));
}
restore_error_handler();
if (!in_array($test->getStatus(), array($BaseTestRunner::STATUS_SKIPPED, $BaseTestRunner::STATUS_INCOMPLETE, $BaseTestRunner::STATUS_FAILURE, $BaseTestRunner::STATUS_ERROR), true)) {