HEX
Server: nginx/1.28.3
System: Linux lightweb-s1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64
User: drdrivek-71 (1047)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: /home/eslinced-103/brise-edu.or.kr/tests/Feature/Tenant/PostsTest.php
<?php

namespace Tests\Feature\Tenant;

use PHPUnit\Framework\Attributes\Test;
use App\Models\Post;
use Tests\TenantTestCase;

final class PostsTest extends TenantTestCase
{
    protected $shouldSeed = false;

    #[Test]
    public function posts_can_be_created(): void
    {
        $this->post('/posts', [
            'title' => 'Foo',
            'body' => 'Bar',
        ]);

        $this->assertSame('Foo', Post::first()->title);
        $this->assertSame('Bar', Post::first()->body);
    }

    #[Test]
    public function posts_appear_on_the_post_index(): void
    {
        auth()->user()->posts()->create([
            'title' => 'Foo post',
            'body' => 'Bar',
        ]);

        $this->get('/posts')
            ->assertSee('Foo post');
    }

    #[Test]
    public function each_post_has_a_detail_page(): void
    {
        $this->post('/posts', [
            'title' => 'Foo post',
            'body' => 'Bar',
        ]);

        $this->get('/posts/1')
            ->assertSee('Foo post');
    }
}