Search code examples
laravelphpunitlaravel-artisan

test comman works in terminal but not in php


When i execute php artisan test --testsuite=myTestsuite in the terminal i get the right result which is just this testsuite exucuted with its tests.

But when i execute php artisan myCommand: commandFile

Then the testsuite which is listed first in the phpunit.xml is executed first and then the one which i passed the name.

Has somebody an idea why this is happening?


Solution

  • solved it with

    shell_exec('php artisan test --testsuite=MyTestsuite')
    

    if somebody finds a other solution please let me know. Thanks