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]: ArchTest.php not running on Windows #1312

Open
adevade opened this issue Nov 12, 2024 · 0 comments
Open

[Bug]: ArchTest.php not running on Windows #1312

adevade opened this issue Nov 12, 2024 · 0 comments
Labels

Comments

@adevade
Copy link
Contributor

adevade commented Nov 12, 2024

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 --arch and see that ArchTest.php is not included
  • Add <file>tests\ArchTest.php</file> with backslash to testsuite in phpunit.xml
  • Run pest --arch again 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
@adevade adevade added the bug label Nov 12, 2024
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