Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpunit deprecation notices only displayed when defining source directory #5074

Closed
wickedOne opened this issue Oct 9, 2022 · 5 comments
Closed
Assignees
Labels
feature/test-runner CLI test runner type/bug Something is broken version/9 Something affects PHPUnit 9

Comments

@wickedOne
Copy link

wickedOne commented Oct 9, 2022

Q A
PHPUnit version 9.5.25
PHP version 7.4.24
Installation Method Composer

Summary

when running phpunit without defining a source directory at the end of your command it does not display phpunit's (deprecation) warnings

Current behavior

this does not display phpunit's (deprecation) warnings

vendor/bin/phpunit --testsuite=Foo

while this does (e.g. Warning: Test case class not matching filename is deprecated)

vendor/bin/phpunit --testsuite=Foo tests/

How to reproduce

minimal, self-contained test case to reproduce can be found over here

Expected behavior

i'm not quite sure what is to be expected (i.e. is this expected behaviour or a bug). personally i'd expect the (deprecation) warnings to be shown regardless or perhaps have a flag to have them displayed

@wickedOne wickedOne added the type/bug Something is broken label Oct 9, 2022
@sebastianbergmann
Copy link
Owner

sebastianbergmann commented Oct 9, 2022

Can you reproduce the issue with PHPUnit 9.5.25?

Nevermind, your composer.lock file says 9.5.25 (not 9.5.20 like your ticket).

@sebastianbergmann sebastianbergmann added the feature/test-runner CLI test runner label Oct 9, 2022
@wickedOne
Copy link
Author

sorry for that, updated the ticket for completeness

@sebastianbergmann
Copy link
Owner

I can confirm that this problem still exists in PHPUnit 9.5.28.

sebastianbergmann added a commit that referenced this issue Feb 1, 2023
@sebastianbergmann sebastianbergmann added the version/9 Something affects PHPUnit 9 label Feb 4, 2023
@sebastianbergmann sebastianbergmann self-assigned this Feb 4, 2023
@joakimbo
Copy link

Not sure its as easy as this but I also came across this issue and guessing they have the same origin one possible solution is to add the warnings from the suite to the result from the TestSuiteMapper map() function i.e.

// TextUI\TestSuiteMapper:89
...
if (!$testSuiteEmpty) {
    $result->addTest($testSuite);
    foreach ($testSuite->warnings() as $warning) {
        $result->addWarning($warning);
    }
}
...

@sebastianbergmann
Copy link
Owner

I am sorry for not getting to this before the end of bugfix support for PHPUnit 9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/test-runner CLI test runner type/bug Something is broken version/9 Something affects PHPUnit 9
Projects
None yet
Development

No branches or pull requests

3 participants