forked from eatvio/eatvio-infra
43 lines
800 B
PHP
43 lines
800 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Feature\Recipe;
|
|
|
|
use App\Models\Recipe;
|
|
use App\Models\User;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
final class EditFormTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
protected User $user;
|
|
|
|
private Recipe $recipe;
|
|
|
|
public function setUp(): void
|
|
{
|
|
$this->refreshApplicationWithLocale('en');
|
|
|
|
$this->user = User::factory()->create(['is_consultant' => true]);
|
|
|
|
$this->recipe = Recipe::inRandomOrder()->first();
|
|
}
|
|
|
|
public function test_edit_page_recipe_success(): void
|
|
{
|
|
$response = $this
|
|
->actingAs($this->user)
|
|
->get(route('recipe.edit', $this->recipe, false));
|
|
|
|
$response->assertSuccessful();
|
|
}
|
|
|
|
}
|
|
|