![](/img/trans.png)
[英]Call to undefined method Tests\Unit\TopPageTest::get() in Unit test in Laravel 8
[英]Laravel unit test: method get/post is undefined
我正在嘗試創建一個單元測試,但即使是這樣的簡單代碼
$response = $this->get('/');
$response->assertStatus(200);
返回
1) Tests\Unit\BookTest::test_adding_book
Error: Call to undefined method Tests\Unit\BookTest::get()
注釋或刪除“使用 PHPUnit\Framework\TestCase;” 並添加“使用 Tests\TestCase;”
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.