8000 deprecate the testLegacy test name prefix · symfony/symfony@550e86b · GitHub
[go: up one dir, main page]

Skip to content

Commit 550e86b

Browse files
committed
deprecate the testLegacy test name prefix
1 parent 1099f6b commit 550e86b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ public function endTest(\PHPUnit_Framework_Test $test, $time)
197197
DnsMock::withMockedHosts(array());
198198
}
199199
}
200+
201+
if ($test instanceof \PHPUnit_Framework_TestCase && 0 === strpos($test->getName(), 'testLegacy') && empty($test->getTestResultObject()->warningCount())) {
202+
$result = $test->getTestResultObject();
203+
$result->addWarning($test, new \PHPUnit_Framework_Warning('Using the testLegacy prefix to mark tests as legacy is deprecated since version 3.3 and will be removed in 4.0. Use the "@group legacy" notation instead to add the test to the legacy group.'), $time);
204+
}
200205
}
201206

202207
public function handleError($type, $msg, $file, $line, $context)

0 commit comments

Comments
 (0)
0