-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
| Q | A |
|---|---|
| PHPUnit version | 9.5.1 |
| PHP version | 7.4.14 |
| Installation Method | Composer |
Summary
(See https://youtrack.jetbrains.com/issue/WI-57958)
While working on a project making heavy use of at() in the test suite I noticed (again) that soft deprecations cause tests to be marked as failed, although the exit code is 0.
I've traced this to \PHPUnit\Util\Log\TeamCity::addWarning(), which logs a testFailed event.
A quick search did not reveal a list of possible event names, so I put a comment in https://youtrack.jetbrains.com/issue/WI-57958 to get help from Jetbrains.
Current behavior
Test cases with warnings are logged with testFailed event type
How to reproduce
Run a test with at() matcher or assertRegExp() or other soft-deprecated features using the --teamcity command line option:
tlamy@Thomass-iMac-Pro messaging % ./vendor/bin/phpunit tests/unittests --teamcity
PHPUnit 9.5.1 by Sebastian Bergmann and contributors.
##teamcity[testCount count='252' flowId='25286']
##teamcity[testSuiteStarted name='/Users/tlamy/git/XXX/tests/unittests' flowId='25286']
##teamcity[testStarted name='createDialogFilters' locationHint='php_qn:///Users/tlamy/git/XXX/tests/unittests/Messaging/Model/RepositoryTest.php::\Tests\unittests\Messaging\Model\RepositoryTest::createDialogFilters' flowId='25286']
##teamcity[testFailed name='createDialogFilters' message='The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.' details=' ' duration='0' flowId='25286']
##teamcity[testFinished name='createDialogFilters' duration='0' flowId='25286']
...
Expected behavior
Use another event name (not testFailed), so PhpStorm does not mark the test case as failed.