0

我正在玩 Livewire 2 和 Laravel 8 的全新安装,但在尝试运行 phpunit 测试时,我得到了一个RuntimeException : A facade root has not been set.. 我尝试了标准缓存清理,但似乎没有任何效果。还有人看到这个吗?下面是我正在运行的完整测试。

<?php

namespace Tests\Unit;

use App\Http\Livewire\Properties\CreateProperty;
use Livewire\Livewire;
use PHPUnit\Framework\TestCase;

class CreatePropertyTest extends TestCase
{
    /**
     * @test
     */
    public function form_has_expected_labels()
    {
        Livewire::test(CreateProperty::class)
            ->assertSee('Property Name')
            ->assertSee('Address');
    }
}
4

1 回答 1

2

将 TestCase 的 use 语句从

use PHPUnit\Framework\TestCase;

use Tests\TestCase;

于 2020-09-16T12:02:07.607 回答