Making a test for database with Laravel (8.44.0) assetion assertModelExists(), fails on an error.
Error : Call to undefined method Tests\Feature\CommuneTest::assertModelExists()
The test class looks like this
<?php
namespace Tests\Feature;
use App\Models\Commune;
use Illuminate\Foundation\Testing\Concerns\InteractsWithDatabase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class CommuneTest extends TestCase
{
use RefreshDatabase, InteractsWithDatabase;
/**
* Test can save a commune model on DB
*
* @return void
* @test
*/
public function canStoreDb()
{
$commune = Commune::factory()->create();
$this->assertModelExists($commune);
}
}
What do you think is missing?