From 838be177142031ffc50c73a873ae117e58e0e290 Mon Sep 17 00:00:00 2001 From: Rastislav Chynoransky Date: Tue, 9 Jul 2024 16:58:33 +0200 Subject: [PATCH] Fix fake images in tests --- database/factories/PhotoFactory.php | 4 +++- tests/Feature/SitemapTest.php | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/database/factories/PhotoFactory.php b/database/factories/PhotoFactory.php index 113e12b..d1c23fd 100644 --- a/database/factories/PhotoFactory.php +++ b/database/factories/PhotoFactory.php @@ -26,7 +26,9 @@ public function withMedia(): Factory { return $this->afterCreating(function (Photo $photo) { $photo - ->addMediaFromUrl($this->faker->imageUrl()) + ->addMediaFromBase64( + 'R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==', + ) ->toMediaCollection('photos'); }); } diff --git a/tests/Feature/SitemapTest.php b/tests/Feature/SitemapTest.php index d2adde8..ed7bc80 100644 --- a/tests/Feature/SitemapTest.php +++ b/tests/Feature/SitemapTest.php @@ -21,12 +21,10 @@ public function test_sitemap_lists_static_pages() ->assertSee(route('artworks.index')); } - public function tests_litsts_presentable_artworks() + public function test_sitemap_lists_presentable_artworks() { $privateArtwork = Artwork::factory()->create(); - $presentableArtwork = Artwork::factory() - ->presentable() - ->create(); + $presentableArtwork = Artwork::factory()->presentable()->create(); $this->get('/sitemap.xml') ->assertSee(route('artworks.show', $presentableArtwork))