我執行PhPUnit,覆蓋率報告無法生成,Laravel版本:5.2 Php版本:7.3.11。日志輸出為:PHPUnit 4.8.36 由 Sebastian Bergmann 和貢獻者提供。.使用時間: 1.51 秒, 內存: 22.00MB正常(1 個測試,1 個斷言)正在生成 HTML 格式的代碼覆蓋率報告...count():參數必須是實現 Countable 的數組或對象我不知道這里怎么了?這是我的測試源:<?phpuse Illuminate\Foundation\Testing\WithoutMiddleware;use Illuminate\Foundation\Testing\DatabaseMigrations;use Illuminate\Foundation\Testing\DatabaseTransactions;use Illuminate\Http\Response;class TravelControllerTest extends TestCase{ /** * A basic functional test example. * * @return void */ public function testBasicExample() { $response = $this->json('GET', '/v1/abc', ['id' => 'Sally']); $response->assertSessionHas('temporary_id', $value = 'Sally'); }}
1 回答

慕的地8271018
TA貢獻1796條經驗 獲得超4個贊
升級PHPUnit和PhpCodeCoverage軟件包將是解決方案。你的軟件包已經過時了!這是舊版本中的一個錯誤。
以下是有關此主題的一些討論:
https://github.com/Codeception/Codeception/issues/4703
https://github.com/sebastianbergmann/php-code-coverage/issues/551
- 1 回答
- 0 關注
- 132 瀏覽
添加回答
舉報
0/150
提交
取消