diff --git a/tests/Unit/NotesTest.php b/tests/Unit/NotesTest.php index 784f7a59..61cd9381 100644 --- a/tests/Unit/NotesTest.php +++ b/tests/Unit/NotesTest.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Tests\Unit; use App\Models\{Contact, Media, Note, Place, Tag}; +use Illuminate\Filesystem\Filesystem; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\Cache; use GuzzleHttp\Client; @@ -65,8 +66,6 @@ class NotesTest extends TestCase */ public function specificProfileImageUsedInMakehcardsMethod(): void { - // phpcs:ignore - $expected = '
' . PHP_EOL; Contact::factory()->create([ 'nick' => 'aaron', 'name' => 'Aaron Parecki', @@ -74,9 +73,17 @@ class NotesTest extends TestCase 'twitter' => null, 'facebook' => 123456, ]); + $fileSystem = new Filesystem(); + $fileSystem->ensureDirectoryExists(public_path('/assets/profile-images/aaronparecki.com')); + if (!$fileSystem->exists(public_path('/assets/profile-images/aaronparecki.com/image'))) { + $fileSystem->copy('./tests/aaron.png', public_path('/assets/profile-images/aaronparecki.com/image')); + } $note = Note::factory()->create([ 'note' => 'Hi @aaron', ]); + + // phpcs:ignore + $expected = '' . PHP_EOL; $this->assertEquals($expected, $note->note); }