vendor/bin/phpunit ./packages/navidbakhtiary/todo/tests/Feature/LabelTest.php will do it
or you could pass in the full namespace qualified class name to the --filter option
Hello. I have a package that has a tests directory. The tests feature directory includes LabelTest.php and TaskLabelTest.php. Both LabelTest and TaskLabelTest run when vendor\bin\phpunit --filter LabelTest is run. Because of the "LabelTest" pattern in their names. how to run just one of them by writing its specific name? I tried different solutions but I did not succeed. Please show me a way.
thanks for your help
phpunit.xml in main directory of laravel project
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
<testsuite name="NavidBakhtiary\ToDo\Tests\Feature">
<directory suffix="Test.php">./packages/navidbakhtiary/todo/tests/Feature</directory>
</testsuite>
<testsuite name="NavidBakhtiary\ToDo\Tests\Unit">
<directory suffix="Test.php">./packages/navidbakhtiary/todo/tests/Unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
</whitelist>
</filter>
<php>
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="DB_CONNECTION" value="sqlite"/>
<server name="DB_DATABASE" value=":memory:"/>
<server name="MAIL_MAILER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
</php>
</phpunit>
structure of package directories
laravel project
|---app
|---packages
| |---navidbakhtiary
| |---todo
| |---src
| |---tests
| |---Feature
| |---LabelTest.php
| |---TaskLabelTest.php
| |---Unit
|---phpunit.xml
vendor/bin/phpunit ./packages/navidbakhtiary/todo/tests/Feature/LabelTest.php will do it
or you could pass in the full namespace qualified class name to the --filter option
Please or to participate in this conversation.