Level 74
Change
use PHPUnit\Framework\TestCase;
To
use Tests\TestCase;
I don't know why the unit tests no longer uses the "correct" TestCase. You can most likely find out why in the documentation.
1 like
I use this factory in feauture test and it is working. What is the problem in unit testing?
namespace Tests\Unit;
use PHPUnit\Framework\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ReplyTest extends TestCase
{
use RefreshDatabase;
/** @test */
public function it_has_body()
{
$reply = factory('App\Reply')->create();
$this->assertInstanceOf('App\User', $reply->owner);
}
}
Change
use PHPUnit\Framework\TestCase;
To
use Tests\TestCase;
I don't know why the unit tests no longer uses the "correct" TestCase. You can most likely find out why in the documentation.
Please or to participate in this conversation.