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

[Bug]: Overriding parent tests gives TestCaseAlreadyInUse #1303

Open
riabiy opened this issue Oct 19, 2024 · 1 comment
Open

[Bug]: Overriding parent tests gives TestCaseAlreadyInUse #1303

riabiy opened this issue Oct 19, 2024 · 1 comment
Labels

Comments

@riabiy
Copy link

riabiy commented Oct 19, 2024

What Happened

Hi. I can be missing something and I believe it's a bug, nevertheless.
Any attempt to override any parent test class gives me TestCaseAlreadyInUse.

Same thing happens both for pest()->extend(SpecificTestCase::class) in the test file and in the Pest.php file.

How to Reproduce

//Pest.php

pest()->extend(DuskTestCase::class)->in('Browser');
//can be in the Specific/AnyTest.php or in the Pest.php, both give same result
pest()->extend(SpecificDuskTestCase::class)->in('Browser/Tests/Specific'); 

Sample Repository

No response

Pest Version

3.4.1

PHP Version

8.3.7

Operation System

macOS

Notes

If this is the desired behaviour, what is the recommended way to override parent class for very-very 1-time niche cases?
In PHPUnit it's just vanilla PHP.
Creating a folder with "PestCanNotOverridePlaceHere" is a bit meh and not Laravelish enough, IMHO.

@riabiy riabiy added the bug label Oct 19, 2024
@riabiy
Copy link
Author

riabiy commented Oct 19, 2024

Could be a duplicate of #1109 and related to #765.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant