From 0c060931ee67d6ada00b58238acc55f490f7cf01 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 1 Jan 2017 23:34:28 +0100 Subject: [PATCH] respect skipped and incomplete tests --- src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php b/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php index 0d873732636a9..1420deab45b5d 100644 --- a/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php +++ b/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php @@ -174,11 +174,14 @@ public function endTest(\PHPUnit_Framework_Test $test, $time) { if ($this->expectedDeprecations) { restore_error_handler(); - try { - $prefix = "@expectedDeprecation:\n "; - $test->assertStringMatchesFormat($prefix.implode("\n ", $this->expectedDeprecations), $prefix.implode("\n ", $this->gatheredDeprecations)); - } catch (\PHPUnit_Framework_AssertionFailedError $e) { - $test->getTestResultObject()->addFailure($test, $e, $time); + + if (!in_array($test->getStatus(), array(\PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED, \PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE), true)) { + try { + $prefix = "@expectedDeprecation:\n "; + $test->assertStringMatchesFormat($prefix.implode("\n ", $this->expectedDeprecations), $prefix.implode("\n ", $this->gatheredDeprecations)); + } catch (\PHPUnit_Framework_AssertionFailedError $e) { + $test->getTestResultObject()->addFailure($test, $e, $time); + } } $this->expectedDeprecations = $this->gatheredDeprecations = array();