diff --git a/composer.lock b/composer.lock index dc67362..1bf3663 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "71767f4485e6335b0a9d934fafcfad8e", + "content-hash": "f1504229d84c399a1c8aea12005e3530", "packages": [ { "name": "aalaap/faker-youtube", @@ -13868,3 +13868,4 @@ "platform-dev": [], "plugin-api-version": "2.6.0" } + diff --git a/tests/Feature/Plan/CreateTest.php b/tests/Feature/Plan/CreateTest.php index c96d2c1..34225b3 100644 --- a/tests/Feature/Plan/CreateTest.php +++ b/tests/Feature/Plan/CreateTest.php @@ -24,7 +24,7 @@ class CreateTest extends TestCase public function setUp(): void { - parent::setUp(); + $this->refreshApplicationWithLocale('en'); Storage::fake('plans'); $this->image = UploadedFile::fake()->image('plan.png'); @@ -32,7 +32,6 @@ class CreateTest extends TestCase $this->user = User::factory()->create(['is_consultant' => true]); $this->plan = Plan::factory()->make(); - $this->refreshApplicationWithLocale('en'); } public function test_show_form_create_plan() @@ -42,7 +41,6 @@ class CreateTest extends TestCase ->get(route('plan.create')); $response->assertSuccessful(); - // ->assertRedirect(route('home')); } public function test_publish_new_plan_success(): void diff --git a/tests/Feature/Plan/ShowTest.php b/tests/Feature/Plan/ShowTest.php index aa4cbb2..7c060d3 100644 --- a/tests/Feature/Plan/ShowTest.php +++ b/tests/Feature/Plan/ShowTest.php @@ -26,20 +26,19 @@ class ShowTest extends TestCase public function setUp(): void { - parent::setUp(); + $this->refreshApplicationWithLocale('en'); Storage::fake('plans'); $this->image = UploadedFile::fake()->image('plan.png'); $this->user = User::factory()->create(['is_consultant' => true]); $this->plan = Plan::inRandomOrder()->first(); - $this->refreshApplicationWithLocale('en'); } - public function test_show_form_success() + public function test_show_page_success() { $response = $this->actingAs($this->user) - ->get(route('plan.show', ['plan' => $this->plan->id])); + ->get(route('plan.show', $this->plan, false)); $response ->assertOk(); diff --git a/tests/Feature/Recipe/CreateTest.php b/tests/Feature/Recipe/CreateTest.php index 93a0310..3bb77ce 100644 --- a/tests/Feature/Recipe/CreateTest.php +++ b/tests/Feature/Recipe/CreateTest.php @@ -30,7 +30,7 @@ final class CreateTest extends TestCase public function setUp(): void { - parent::setUp(); + $this->refreshApplicationWithLocale('en'); Storage::fake('recipes'); @@ -38,11 +38,9 @@ final class CreateTest extends TestCase $this->user = User::factory()->create(['is_consultant' => true]); $this->recipe = Recipe::factory()->make(); - - $this->refreshApplicationWithLocale('en'); } - public function testShowFormCreateRecipe(): void + public function test_show_page_create_recipe(): void { $response = $this ->actingAs($this->user) @@ -51,7 +49,7 @@ final class CreateTest extends TestCase $response->assertSuccessful(); } - public function testPublishNewRecipeSuccess(): void + public function test_publish_new_recipe_success(): void { $this->actingAs($this->user); @@ -82,7 +80,7 @@ final class CreateTest extends TestCase self::assertEquals($count + 1, Recipe::count()); } - public function testToDraftNewRecipeSuccess(): void + public function test_to_draft_new_recipe_success(): void { $this->actingAs($this->user); @@ -115,7 +113,7 @@ final class CreateTest extends TestCase self::assertEquals(Recipe::find($count + 1)->state, 'archived'); } - public function testToPreviewNewRecipeSuccess(): void + public function test_to_preview_new_recipe_success(): void { $this->actingAs($this->user); @@ -148,7 +146,7 @@ final class CreateTest extends TestCase self::assertEquals(Recipe::find($count + 1)->state, 'archived'); } - public function testSetEmptyData(): void + public function test_set_empty_data(): void { $this->actingAs($this->user); @@ -169,7 +167,7 @@ final class CreateTest extends TestCase self::assertEquals($count, Recipe::count()); } - public function testIncorrectVideoUrl(): void + public function test_incorrect_video_url(): void { $this->actingAs($this->user); @@ -198,3 +196,4 @@ final class CreateTest extends TestCase self::assertEquals($count, Recipe::count()); } } + diff --git a/tests/Feature/Recipe/EditFormTest.php b/tests/Feature/Recipe/EditFormTest.php index 3975487..8b24072 100644 --- a/tests/Feature/Recipe/EditFormTest.php +++ b/tests/Feature/Recipe/EditFormTest.php @@ -22,22 +22,21 @@ final class EditFormTest extends TestCase public function setUp(): void { - parent::setUp(); + $this->refreshApplicationWithLocale('en'); $this->user = User::factory()->create(['is_consultant' => true]); $this->recipe = Recipe::inRandomOrder()->first(); - - $this->refreshApplicationWithLocale('en'); } - public function testShowFormEditRecipe(): void + public function test_edit_page_recipe_success(): void { $response = $this ->actingAs($this->user) - ->get(route('recipe.edit', ['recipe' => $this->recipe->id])); + ->get(route('recipe.edit', $this->recipe, false)); $response->assertSuccessful(); } } + diff --git a/tests/Feature/Recipe/IndexTest.php b/tests/Feature/Recipe/IndexTest.php index d4ea94a..13557f0 100644 --- a/tests/Feature/Recipe/IndexTest.php +++ b/tests/Feature/Recipe/IndexTest.php @@ -17,14 +17,13 @@ class IndexTest extends TestCase public function setUp(): void { - parent::setUp(); + $this->refreshApplicationWithLocale('en'); $this->user = User::factory()->create(['is_consultant' => true]); $this->recipe = Recipe::inRandomOrder()->first(); - $this->refreshApplicationWithLocale('en'); } - public function test_show_form_success() + public function test_index_page_success() { $response = $this ->actingAs($this->user) @@ -34,3 +33,4 @@ class IndexTest extends TestCase ->assertOk(); } } + diff --git a/tests/Feature/Recipe/ShowTest.php b/tests/Feature/Recipe/ShowTest.php index 7e44036..cc71420 100644 --- a/tests/Feature/Recipe/ShowTest.php +++ b/tests/Feature/Recipe/ShowTest.php @@ -17,19 +17,19 @@ class ShowTest extends TestCase public function setUp(): void { - parent::setUp(); + $this->refreshApplicationWithLocale('en'); $this->user = User::factory()->create(['is_consultant' => true]); $this->recipe = Recipe::inRandomOrder()->first(); - $this->refreshApplicationWithLocale('en'); } - public function test_show_form_success() + public function test_show_page_success() { $response = $this->actingAs($this->user) - ->get(route('recipe.show', ['recipe' => $this->recipe->id])); + ->get(route('recipe.show', $this->recipe, false)); $response ->assertOk(); } } +