pest
pest copied to clipboard
[Bug]: `ArchTest.php` not running on Windows
What Happened
I have copied the test structure from Pinkary, with an Arch folder and an ArchTest.php file in the root. I have added a new testsuite to phpunit.xml with the folder and file. The file is not included when running pest --arch, until I add it to the testsuite with a backslash.
<testsuite name="Arch">
<directory>tests/Arch</directory>
<file>tests/ArchTest.php</file>
<file>tests\ArchTest.php</file><!-- If I add this it automatically runs on Windows -->
</testsuite>
I believe this to be a Windows issue because of the backward slash. Also, it's possible that it is a PHPUnit issue, but I thought that I'd open it here first and get some feedback.
How to Reproduce
- Install Pinkary project on Windows machine
- Run
pest --archand see thatArchTest.phpis not included - Add
<file>tests\ArchTest.php</file>with backslash to testsuite inphpunit.xml - Run
pest --archagain and see that the file is included
Sample Repository
https://github.com/pinkary-project/pinkary.com
Pest Version
3.5.1
PHP Version
8.3.13
Operation System
Windows
Notes
Running without backslash:
❯ pest --arch
PASS Tests\Arch\LivewireTest
✓ livewire components 0.13s
Tests: 1 passed (2 assertions)
Duration: 0.28s
Running with backslash:
❯ pest --arch
PASS Tests\Arch\LivewireTest
✓ livewire components 0.39s
PASS Tests\ArchTest
✓ preset → php 0.28s
✓ preset → security 0.01s
✓ preset → laravel → ignoring 'App\Providers\Filament' 0.12s
Tests: 4 passed (43 assertions)
Duration: 1.08s