<?php

namespace Tests\Unit;

use Tests\TestCase;

use App\Models\Page;
use App\Models\PageRedirect;

class PageRedirectTest extends TestCase
{
    public function test_page_redirect_has_a_url_attribute(): void
    {
        $page = Page::factory()->create();
        $page->publish();

        $page_redirect = PageRedirect::factory()->create([
            'redirect' => $page->id,
        ]);

        $this->assertNotNull($page_redirect->url);
        $this->assertEquals($page->full_slug, $page_redirect->url);
    }
}
