今天在laravel单元测试中使用Http请求接口时,报错显示A facade root has not been set.

默认单元测试的代码是这样的
<?php
namespace Tests\Unit;
use Illuminate\Support\Facades\Http;
use PHPUnit\Framework\TestCase;
use Tests\CreatesApplication;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*/
public function test_that_true_is_true(): void
{
$resp= Http::get('https://b.exam

最低0.47元/天 解锁文章
1440

被折叠的 条评论
为什么被折叠?



