<?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);
    }
}
