You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It throws this error as the testCase Class is not PHPUnit\Framework\TestCase; It is Tests\TestCase Which is logic as it is set in the uses function. If I comment out the condition if ($testCase->class !== TestCase::class) {
What if the check would check the class not equals the current class and is instance of TestCase::class for example
What Happened
When use in Laravel Application with custom Module Structure, I didnt manage to get uses function which calls UsesCall Class to work as expected.
If for example:
It throws this error as the testCase Class is not PHPUnit\Framework\TestCase; It is Tests\TestCase Which is logic as it is set in the uses function. If I comment out the condition if ($testCase->class !== TestCase::class) {
What if the check would check the class not equals the current class and is instance of TestCase::class for example
Then it works as expected.
But It might be me that not understand the context of Why throwing an TestCaseAlreadyInUse Exception when Classes not Equals.
How to Reproduce
Install a fresh Laravel app, create a modules folder in Root. Create some modules
modules/User/tests/Feature
modules/Products/tests/Feature
Add a section for Modules in phpunit.xml
Try to use uses in Pest.php in Feature, DIR./../modules/*/tests
Then it will throw TestCaseAlreadyInUse.
Then my Idea was to Move the uses function to the different TestFiles, but with the same Result.
Sample Repository
No response
Pest Version
v2.34.0
PHP Version
8.3.3
Operation System
macOS
Notes
No response
The text was updated successfully, but these errors were encountered: