Got error message Unable to create test case for test file at...
How to Reproduce
Create any test file which will produce invalid PHP class name, such as 2FATest.php
Sample Repository
No response
Pest Version
2.24.0
PHP Version
8.1.20
Operation System
macOS, Windows, Linux
Notes
This could be handled by prefixing test class names and replacing any other characters that might be present in test file names but are invalid as parts of PHP class name. Prefix could for example be Pest_$i_ so that +Test.php and =Test.php would not produce the same class names.
Namespaces seem to be handled already, for example folder name A+=BC produces namespace P\Tests\Feature\ABC. However, when folders/files +ABC/Test.php and ABC/Test.php both exist, the second file is skipped on complete test suite run.
EDIT: namespaces starting with numbers also do not create valid test case files.
What Happened
Got error message
Unable to create test case for test file at...
How to Reproduce
Create any test file which will produce invalid PHP class name, such as
2FATest.php
Sample Repository
No response
Pest Version
2.24.0
PHP Version
8.1.20
Operation System
macOS, Windows, Linux
Notes
This could be handled by prefixing test class names and replacing any other characters that might be present in test file names but are invalid as parts of PHP class name. Prefix could for example be
Pest_$i_
so that+Test.php
and=Test.php
would not produce the same class names.Namespaces seem to be handled already, for example folder name
A+=BC
produces namespaceP\Tests\Feature\ABC
. However, when folders/files+ABC/Test.php
andABC/Test.php
both exist, the second file is skipped on complete test suite run.EDIT: namespaces starting with numbers also do not create valid test case files.