Made test coverage for PageBuilder controllers and models

This commit is contained in:
2025-05-06 00:13:06 +02:00
parent dd5585c3d1
commit 4ae0edad49
15 changed files with 394 additions and 11 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace Tests\Unit;
use Tests\TestCase;
use App\Models\Page;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
class PageTest extends TestCase
{
use RefreshDatabase;
public function test_page_creation()
{
$page = Page::factory()->create();
$this->assertDatabaseHas('pages', ['id' => $page->id]);
}
public function test_page_has_author_relationship()
{
$page = Page::factory()->create();
$this->assertInstanceOf(User::class, $page->author);
}
}