Closed eusonlito closed 1 year ago
Your reproducing example is neither minimal nor self-contained.
I don't know how to create a minimal version of this tests (and not attached to Laravel).
I will close the issue for now then and try to create a version compatible with the issue in the future. Thanks anyway :)
I have found the issue. My Test folders include the base Abstract Classes and the tests was loaded with <directory>
tag, then the abstract classes also was loaded.
I have Updated my phpunit.xml tests from:
<testsuites>
<testsuite name="Controller">
<directory suffix=".php">./app/Domains/App/Test/Controller</directory>
<directory suffix=".php">./app/Domains/Dashboard/Test/Controller</directory>
<directory suffix=".php">./app/Domains/PWA/Test/Controller</directory>
<directory suffix=".php">./app/Domains/Tag/Test/Controller</directory>
<directory suffix=".php">./app/Domains/Team/Test/Controller</directory>
<directory suffix=".php">./app/Domains/User/Test/Controller</directory>
<directory suffix=".php">./app/Domains/User/Test/ControllerApi</directory>
</testsuite>
<testsuite name="Unit">
<directory suffix=".php">./app/Domains/Tag/Test/Unit</directory>
</testsuite>
</testsuites>
to
<testsuites>
<testsuite name="Controller">
<directory suffix=".php">./app/Domains/App/Test/Controller</directory>
<directory suffix=".php">./app/Domains/Dashboard/Test/Controller</directory>
<directory suffix=".php">./app/Domains/PWA/Test/Controller</directory>
<directory suffix=".php">./app/Domains/Tag/Test/Controller</directory>
<directory suffix=".php">./app/Domains/Team/Test/Controller</directory>
<directory suffix=".php">./app/Domains/User/Test/Controller</directory>
<directory suffix=".php">./app/Domains/User/Test/ControllerApi</directory>
<exclude>./app/Domains/App/Test/Controller/ControllerAbstractTestCase.php</exclude>
<exclude>./app/Domains/Dashboard/Test/Controller/ControllerAbstractTestCase.php</exclude>
<exclude>./app/Domains/PWA/Test/Controller/ControllerAbstractTestCase.php</exclude>
<exclude>./app/Domains/Tag/Test/Controller/ControllerAbstractTestCase.php</exclude>
<exclude>./app/Domains/Team/Test/Controller/ControllerAbstractTestCase.php</exclude>
<exclude>./app/Domains/User/Test/Controller/ControllerAbstractTestCase.php</exclude>
<exclude>./app/Domains/User/Test/ControllerApi/ControllerApiAbstractTestCase.php</exclude>
</testsuite>
<testsuite name="Unit">
<directory suffix=".php">./app/Domains/Tag/Test/Unit</directory>
<exclude>./app/Domains/Tag/Test/Unit/UnitAbstractTestCase.php</exclude>
</testsuite>
</testsuites>
And the error is gone.
Related with https://github.com/sebastianbergmann/phpunit/issues/5181#issuecomment-1570382464
Summary
I have this open source project based in Laravel 10 using PHPUnit 10.1.3: https://github.com/eusonlito/Password-Manager
After migrate to PHPUnit 10 I get this warnings:
How to reproduce
Expected behavior
Print output without any warning.
Thanks
Thanks a lot for your time on this tool.