I tried to run phpunit with sample test but it was not executing. It shows NO TEST EXECUTED.
My default File contains ExampleTest.php and TestCase.php
C:\xampp\htdocs\amber_fuel>phpunit PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 277
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 277 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 285
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 285 PHPUnit 3.7.21 by Sebastian Bergmann.
Configuration read from C:\xampp\htdocs\amber_fuel\phpunit.xml
Time: 90 ms, Memory: 8.00MB
No tests executed!
It looks like you are running the global instance of PHPUnit on a Windows machine. I had the same problem, and the solution was extremely simple:
If I am in the root directory of my project for example, I would run
vendor\bin\phpunit
Your tests should then run and print the results.
I assume you're running it this way?
./vendor/bin/phpunit
Either enclose it in quotes like so:
"./vendor/bin/phpunit"
Or run it using powershell, by simply typing powershell from cmd then run it the regular way:
./vendor/bin/phpunit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With