Using PhpUnit 6.3 to test a helloWorld() function written in PHP 7.1. The test runs ok if I execute its php file directly from the command line:
> php C:\path\to\phpunit.phar C:\project\hello-world\hello-world_tests.php
OK <1 test, 1 assertion>
However if I rely on my configuration file, no test is run:
> php C:\path\to\phpunit.phar --configuration C:\project\phpunit.xml
No tests executed!
Here is my folder structure:
project/
phpunit.xml
phpunit.phar
hello-world/
hello-world.php
hello-world_test.php
Here is my configuration file, phpunit.xml:
<phpunit>
<testsuites>
<testsuite name="Test suite">
<directory>./hello-world</directory>
</testsuite>
</testsuites>
</phpunit>
Replacing the directory node with a file node gets things working:
<file>./hello-world/hello-world_test.php</file>
that's nice, but I don't want to list all test files individually, which is why I had the directory node originally.
Testat the end -- making it to behelloWorldTest.phpif to include file extenstion.