Fix unit tests
This commit is contained in:
parent
9e788e0fe8
commit
51780523b4
3 changed files with 5 additions and 5 deletions
|
|
@ -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,
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue