【发布时间】:2020-05-21 00:21:30
【问题描述】:
我收到以下错误
PHPUnit\Framework\Exception:PHP 致命错误:未捕获的错误:在 /var/www/html/checkout/routes/api.php:24 中找不到类 'Route'
我尝试过来自Error: Class 'Route' not found in routes.php when testing standalone Laravel package using Orchestra Testbench 的回答。它不工作并给出同样的错误。
下面是我的 XML 代码:
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
<directory suffix=".php">./routes</directory>
<exclude>
<directory >./routes</directory>
<file>./routes/api.php</file>
<file>./routes/web.php</file>
</exclude>
</whitelist>
</filter>```
【问题讨论】:
-
<file>./app/Http/routes/web.php</file>这样试试 -
更改后仍然出错
./app ./app/ http/routes/api.php -
不只是仔细检查这个答案 - stackoverflow.com/questions/49093727/…
标签: php laravel phpunit php-code-coverage