Set CIDatabaseTestCase and CIUnitTestCase abstract#3789
Set CIDatabaseTestCase and CIUnitTestCase abstract#3789samsonasik merged 2 commits intocodeigniter4:developfrom willnode:develop
Conversation
|
Looking at your config at #3788, I think your <whitelist addUncoveredFilesFromWhitelist="true" processUncoveredFilesFromWhitelist="true">
</whitelist> |
|
I did try that, but I get error. Because it's the first file in my app folder, I assumed somehow phpunit redefine App namespace again, but I have no idea what's causes nor how to solve it. Except turning off these settings. Full build log or the project if that's necessary. |
|
The redeclare error seems already fixed in latest php builds development && composer update |
|
Thanks. I tried, but that didn't work for me. I don't know why. I think I will revisit that problem later. I'm happy with my setup. By the way, I seen that a lot phpdoc references changed to Interface due to this commit? That breaks intelephense in VS code (all references goes red, because they don't support |
|
Docblock check is part checked by PHPStan. The PHPStan configuration is at https://github.com/codeigniter4/CodeIgniter4/blob/develop/phpstan.neon.dist .Please create issue if you think there issue with that. |
|
Will do later, thanks. Anyway, any chance this get merged? There maybe some alternatives I don't aware, of course. |
|
Lets wait other review from the team for it. |
|
I tried your repo, and after run: <whitelist addUncoveredFilesFromWhitelist="true" processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
<exclude>
<directory suffix=".php">./app/Views</directory>
<directory suffix=".php">./app/Config</directory>
<file>./app/Config/Routes.php</file>
</exclude>
</whitelist>running tests is succeed: So It probably related with your local dev system. |
MGatner
left a comment
There was a problem hiding this comment.
Current conversation aside, I think this is actually a fine change on its own.
paulbalandan
left a comment
There was a problem hiding this comment.
Making the classes as abstract is not bad since these are not meant to be tested individually.
Project side, I think there is something wrong in your setup causing these to be tested. Here's a portion of my phpunit config.
<testsuites>
<testsuite name="default">
<directory suffix="Test.php">tests/src</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>|
@willnode merged, thank you. |
Description
This is PR I propose to fix #3788 (my own issue)
Checklist: