Files
eatvio-infra/tests/Feature/BlogPost/ShowTest.php
2024-01-10 13:41:43 +03:00

36 lines
716 B
PHP

<?php
namespace Tests\Feature\BlogPost;
use Tests\TestCase;
use App\Models\User;
use App\Models\BlogPost;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ShowTest extends TestCase
{
use RefreshDatabase;
private BlogPost $blogPost;
protected User $user;
public function setUp(): void
{
$this->refreshApplicationWithLocale('en');
$this->user = User::inRandomOrder()->first();
$this->blogPost = BlogPost::inRandomOrder()->first();
}
public function test_show_page_success(): void
{
$response = $this->actingAs($this->user)
->get(route('blog_post.show', $this->blogPost));
$response
->assertOk();
}
}