I am using Laravel and I want to run just one test file, and don't want to rename or edit all over test code, the most convenient place to specify what to ignore and what to run for me is phpunit.xml
so I did this:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="bootstrap/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
<testsuites>
<testsuite name="Application Test Suite">
<!--<directory>./tests/</directory>-->
<file>./tests/RunJustThisTest.php</file>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
</php>
</phpunit>
As you see I commented out ./tests/
folder but all files from it are still being run which is absurd, I don't know even where else is phpunit getting path to that folder??? I want to run just /tests/RunJustThisTest.php
file. And I want to specify it in phpunit.xml
file, not console or messing in code.
I load phpunit.xml file in Netbeans.
"C:\xampp\php\php.exe" "C:\xampp\php\phpunit" "--colors" "--log-junit" "C:\Users\xxx\AppData\Local\Temp\nb-phpunit-log.xml" "--configuration" "C:\xampp\htdocs\yyy\phpunit.xml" "C:\Program Files\NetBeans 8.0.1\php\phpunit\NetBeansSuite.php" "--run=C:\xampp\htdocs\yyy\tests"
PHPUnit 4.8.27 by Sebastian Bergmann and contributors.