我正在尝试执行Phpunit命令,但给我错误

时间:2018-11-12 19:40:11

标签: php laravel phpunit

我正在尝试执行PHPUNIT命令,但它给了我错误。 我正在使用Laravel和Laragon虚拟主机。

Cannot load Xdebug - it was already loaded   

Warning: is_dir() expects parameter 1 to be a valid path, object given in C:\Users\chavoshi\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\Ru nner\BaseTestRunner.php on line 56                                    

Call Stack:                                                           

    0.0007     353808   1. {main}() C:\Users\chavoshi\AppData\Roaming\Composer\vendor\phpunit\phpunit\phpunit:0

    0.0146     728568   2. PHPUnit\TextUI\Command::main() C:\Users\chavoshi\AppData\Roaming\Composer\vendor\phpunit\phpunit\phpunit:53

    0.0146     733128   3. PHPUnit\TextUI\Command->run() C:\Users\chavoshi\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php: 148                                                                   

    0.1731    4128288   4. PHPUnit\TextUI\TestRunner->getTest() C:\Users\chavoshi\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Comma nd.php:169                                                            

    0.1731    4128288   5. is_dir() C:\Users\chavoshi\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:56


Catchable fatal error: Object of class PHPUnit\Framework\TestSuite could not be converted to string in C:\Users\chavoshi\AppData\Roaming\Composer\ vendor\phpunit\phpunit\src\Runner\StandardTestSuiteLoader.php on line 32                                                                    

Call Stack:                                                           

    0.0007     353808   1. {main}() C:\Users\chavoshi\AppData\Roaming\Composer\vendor\phpunit\phpunit\phpunit:0

    0.0146     728568   2. PHPUnit\TextUI\Command::main() C:\Users\chavoshi\AppData\Roaming\Composer\vendor\phpunit\phpunit\phpunit:53

    0.0146     733128   3. PHPUnit\TextUI\Command->run() C:\Users\chavoshi\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php: 148                                                                   

    0.1731    4128288   4. PHPUnit\TextUI\TestRunner->getTest() C:\Users\chavoshi\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Comma nd.php:169                                                            

    0.2650    4128824   5. PHPUnit\TextUI\TestRunner->loadSuiteClass() C:\Users\chavoshi\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\Runne r\BaseTestRunner.php:71                                               

    0.2690    4143096   6. PHPUnit\Runner\StandardTestSuiteLoader->load() C:\Users\chavoshi\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\Ru nner\BaseTestRunner.php:130                                           

    0.2690    4143144   7. str_replace() C:\Users\chavoshi\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\Runner\StandardTestSuiteLoader.php: 32

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

我执行这行命令并解决我的问题吗?

vendor\bin\phpunit tests\UserTest