Fix unit tests

This commit is contained in:
Jonny Barnes 2026-01-04 10:22:32 +00:00
commit 51780523b4
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
3 changed files with 5 additions and 5 deletions

View file

@ -53,7 +53,7 @@ class NoteService
foreach ($this->getMedia($data) as $index => $media) {
$note->media()->attach($media['value']->id, [
'alt_text' => $media['alt_text'],
'alt_text' => $media['alt'],
'order' => $index,
]);
}

View file

@ -236,11 +236,11 @@ class MicropubControllerTest extends TestCase
* Test a valid micropub requests using JSON syntax creates a new note.
*/
#[Test]
public function micropub_client_api_request_creates_new_note(): void
public function micropub_client_api_request_creates_new_note_with_photo(): void
{
Queue::fake();
Media::create([
'path' => 'test-photo.jpg',
'path' => 'media/test-photo.jpg',
'type' => 'image',
]);
SyndicationTarget::factory()->create([
@ -265,12 +265,13 @@ class MicropubControllerTest extends TestCase
'https://mastodon.social/@jonnybarnes',
'https://bsky.app/profile/jonnybarnes.uk',
],
'photo' => [config('filesystems.disks.s3.url') . '/test-photo.jpg'],
'photo' => [config('filesystems.disks.public.url') . '/media/test-photo.jpg'],
],
],
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
);
$response
->dump()
->assertStatus(201)
->assertJson(['response' => 'created']);
Queue::assertPushed(SendWebMentions::class);

View file

@ -43,7 +43,6 @@ class ProcessMediaJobTest extends TestCase
{
$manager = app()->make(ImageManager::class);
Storage::disk('local')->put('media/test-image.jpg', file_get_contents(__DIR__.'/../../test-image.jpg'));
ray(Storage::disk('local')->get('media/test-image.jpg'));
$job = new ProcessMedia('media/test-image.jpg');
$job->handle($manager);