From 7206bab9c2e7fd7df71e47b6f3039ee99a166a13 Mon Sep 17 00:00:00 2001 From: aslan Date: Tue, 11 Jun 2024 10:39:24 +0300 Subject: [PATCH] fix test update news with picture --- tests/Feature/admin/NewsTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Feature/admin/NewsTest.php b/tests/Feature/admin/NewsTest.php index 9cbc7d0..2a7f294 100644 --- a/tests/Feature/admin/NewsTest.php +++ b/tests/Feature/admin/NewsTest.php @@ -79,9 +79,10 @@ class NewsTest extends TestCase public function testUpdateNews(): void { + $file = UploadedFile::fake()->create('fake.jpg', 100); $response = $this->actingAs($this->user) ->withSession(['banned' => false]) - ->patch(route('news.update', $this->news), $this->data); + ->patch(route('news.update', $this->news), [...$this->data, 'photo' => $file]); $response->assertRedirect(route('news.index'));