2020-06-27 14:13:33 +01:00
|
|
|
|
<?php
|
|
|
|
|
|
2021-03-17 18:38:18 +00:00
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2020-06-27 14:13:33 +01:00
|
|
|
|
namespace Tests\Feature;
|
|
|
|
|
|
|
|
|
|
use App\Jobs\ProcessMedia;
|
2020-06-28 16:40:10 +01:00
|
|
|
|
use App\Models\Media;
|
2021-08-31 12:48:43 +01:00
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
2020-06-27 14:13:33 +01:00
|
|
|
|
use Illuminate\Http\UploadedFile;
|
|
|
|
|
use Illuminate\Support\Facades\Queue;
|
|
|
|
|
use Illuminate\Support\Facades\Storage;
|
2024-10-25 20:40:52 +01:00
|
|
|
|
use Illuminate\Support\Str;
|
2025-03-01 15:00:41 +00:00
|
|
|
|
use PHPUnit\Framework\Attributes\Test;
|
2020-06-27 14:13:33 +01:00
|
|
|
|
use Tests\TestCase;
|
|
|
|
|
use Tests\TestToken;
|
|
|
|
|
|
|
|
|
|
class MicropubMediaTest extends TestCase
|
|
|
|
|
{
|
2021-08-31 12:48:43 +01:00
|
|
|
|
use RefreshDatabase;
|
2020-06-27 14:13:33 +01:00
|
|
|
|
use TestToken;
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function empty_response_for_last_upload_when_none_found(): void
|
2020-06-28 16:30:56 +01:00
|
|
|
|
{
|
2020-06-28 16:40:10 +01:00
|
|
|
|
// Make sure there’s no media
|
2024-10-25 20:40:52 +01:00
|
|
|
|
$this->assertCount(0, Media::all());
|
2020-06-28 16:40:10 +01:00
|
|
|
|
|
2020-06-28 16:30:56 +01:00
|
|
|
|
$response = $this->get(
|
|
|
|
|
'/api/media?q=last',
|
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
|
|
|
|
);
|
2020-06-28 17:21:21 +01:00
|
|
|
|
$response->assertStatus(200);
|
|
|
|
|
$response->assertJson(['url' => null]);
|
2020-06-28 16:30:56 +01:00
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function get_request_with_invalid_token_returns_error_response(): void
|
2022-05-14 17:44:14 +01:00
|
|
|
|
{
|
|
|
|
|
$response = $this->get(
|
|
|
|
|
'/api/media?q=last',
|
|
|
|
|
['HTTP_Authorization' => 'Bearer abc123']
|
|
|
|
|
);
|
|
|
|
|
$response->assertStatus(400);
|
|
|
|
|
$response->assertJsonFragment(['error_description' => 'The provided token did not pass validation']);
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function get_request_with_token_without_scope_returns_error_response(): void
|
2022-05-14 17:44:14 +01:00
|
|
|
|
{
|
|
|
|
|
$response = $this->get(
|
|
|
|
|
'/api/media?q=last',
|
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $this->getTokenWithNoScope()]
|
|
|
|
|
);
|
|
|
|
|
$response->assertStatus(400);
|
|
|
|
|
$response->assertJsonFragment(['error_description' => 'The provided token has no scopes']);
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function get_request_with_token_with_insufficient_scope_returns_error_response(): void
|
2022-05-14 17:44:14 +01:00
|
|
|
|
{
|
|
|
|
|
$response = $this->get(
|
|
|
|
|
'/api/media?q=last',
|
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $this->getTokenWithIncorrectScope()]
|
|
|
|
|
);
|
|
|
|
|
$response->assertStatus(401);
|
|
|
|
|
$response->assertJsonFragment(['error_description' => 'The token’s scope does not have the necessary requirements.']);
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function empty_get_request_with_token_receives_ok_response(): void
|
2022-05-14 17:44:14 +01:00
|
|
|
|
{
|
|
|
|
|
$response = $this->get(
|
|
|
|
|
'/api/media',
|
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
|
|
|
|
);
|
|
|
|
|
$response->assertStatus(200);
|
|
|
|
|
$response->assertJson(['status' => 'OK']);
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function client_can_list_last_upload(): void
|
2020-06-27 14:13:33 +01:00
|
|
|
|
{
|
|
|
|
|
Queue::fake();
|
|
|
|
|
$file = __DIR__ . '/../aaron.png';
|
2022-11-16 20:30:08 +00:00
|
|
|
|
$token = $this->getToken();
|
2020-06-27 14:13:33 +01:00
|
|
|
|
|
|
|
|
|
$response = $this->post(
|
|
|
|
|
'/api/media',
|
|
|
|
|
[
|
|
|
|
|
'file' => new UploadedFile($file, 'aaron.png', 'image/png', null, true),
|
|
|
|
|
],
|
2022-11-16 20:30:08 +00:00
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $token]
|
2020-06-27 14:13:33 +01:00
|
|
|
|
);
|
|
|
|
|
|
2022-11-10 22:21:02 +00:00
|
|
|
|
$path = parse_url($response->headers->get('Location'), PHP_URL_PATH);
|
2024-10-26 12:52:43 +01:00
|
|
|
|
$filename = Str::chopStart($path, '/storage/media/');
|
2020-06-27 14:13:33 +01:00
|
|
|
|
|
|
|
|
|
$lastUploadResponse = $this->get(
|
|
|
|
|
'/api/media?q=last',
|
2022-11-16 20:30:08 +00:00
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $token]
|
2020-06-27 14:13:33 +01:00
|
|
|
|
);
|
2022-11-10 22:21:02 +00:00
|
|
|
|
$lastUploadResponse->assertJson(['url' => $response->headers->get('Location')]);
|
2020-06-27 14:13:33 +01:00
|
|
|
|
|
|
|
|
|
// now remove file
|
2025-03-01 15:00:41 +00:00
|
|
|
|
unlink(storage_path('app/private/media/') . $filename);
|
|
|
|
|
$this->removeDirIfEmpty(storage_path('app/private/media'));
|
2020-06-27 14:13:33 +01:00
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function client_can_source_uploads(): void
|
2020-08-15 09:56:33 +01:00
|
|
|
|
{
|
|
|
|
|
Queue::fake();
|
|
|
|
|
$file = __DIR__ . '/../aaron.png';
|
2022-11-16 20:30:08 +00:00
|
|
|
|
$token = $this->getToken();
|
2020-08-15 09:56:33 +01:00
|
|
|
|
|
|
|
|
|
$response = $this->post(
|
|
|
|
|
'/api/media',
|
|
|
|
|
[
|
|
|
|
|
'file' => new UploadedFile($file, 'aaron.png', 'image/png', null, true),
|
|
|
|
|
],
|
2022-11-16 20:30:08 +00:00
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $token]
|
2020-08-15 09:56:33 +01:00
|
|
|
|
);
|
|
|
|
|
|
2022-11-10 22:21:02 +00:00
|
|
|
|
$path = parse_url($response->headers->get('Location'), PHP_URL_PATH);
|
2024-10-26 12:52:43 +01:00
|
|
|
|
$filename = Str::chopStart($path, '/storage/media/');
|
2020-08-15 09:56:33 +01:00
|
|
|
|
|
|
|
|
|
$sourceUploadResponse = $this->get(
|
|
|
|
|
'/api/media?q=source',
|
2022-11-16 20:30:08 +00:00
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $token]
|
2020-08-15 09:56:33 +01:00
|
|
|
|
);
|
|
|
|
|
$sourceUploadResponse->assertJson(['items' => [[
|
2022-11-10 22:21:02 +00:00
|
|
|
|
'url' => $response->headers->get('Location'),
|
2022-11-20 17:10:19 +00:00
|
|
|
|
'mime_type' => 'image/png',
|
2020-08-15 09:56:33 +01:00
|
|
|
|
]]]);
|
|
|
|
|
|
|
|
|
|
// now remove file
|
2025-03-01 15:00:41 +00:00
|
|
|
|
unlink(storage_path('app/private/media/') . $filename);
|
|
|
|
|
$this->removeDirIfEmpty(storage_path('app/private/media'));
|
2020-08-15 09:56:33 +01:00
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function client_can_source_uploads_with_limit(): void
|
2020-08-15 09:56:33 +01:00
|
|
|
|
{
|
|
|
|
|
Queue::fake();
|
|
|
|
|
$file = __DIR__ . '/../aaron.png';
|
2022-11-16 20:30:08 +00:00
|
|
|
|
$token = $this->getToken();
|
2020-08-15 09:56:33 +01:00
|
|
|
|
|
|
|
|
|
$response = $this->post(
|
|
|
|
|
'/api/media',
|
|
|
|
|
[
|
|
|
|
|
'file' => new UploadedFile($file, 'aaron.png', 'image/png', null, true),
|
|
|
|
|
],
|
2022-11-16 20:30:08 +00:00
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $token]
|
2020-08-15 09:56:33 +01:00
|
|
|
|
);
|
|
|
|
|
|
2022-11-10 22:21:02 +00:00
|
|
|
|
$path = parse_url($response->headers->get('Location'), PHP_URL_PATH);
|
2024-10-26 12:52:43 +01:00
|
|
|
|
$filename = Str::chopStart($path, '/storage/media/');
|
2020-08-15 09:56:33 +01:00
|
|
|
|
|
|
|
|
|
$sourceUploadResponse = $this->get(
|
|
|
|
|
'/api/media?q=source&limit=1',
|
2022-11-16 20:30:08 +00:00
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $token]
|
2020-08-15 09:56:33 +01:00
|
|
|
|
);
|
|
|
|
|
$sourceUploadResponse->assertJson(['items' => [[
|
2022-11-10 22:21:02 +00:00
|
|
|
|
'url' => $response->headers->get('Location'),
|
2022-11-20 17:10:19 +00:00
|
|
|
|
'mime_type' => 'image/png',
|
2020-08-15 09:56:33 +01:00
|
|
|
|
]]]);
|
|
|
|
|
// And given our limit of 1 there should only be one result
|
|
|
|
|
$this->assertCount(1, json_decode($sourceUploadResponse->getContent(), true)['items']);
|
|
|
|
|
|
|
|
|
|
// now remove file
|
2025-03-01 15:00:41 +00:00
|
|
|
|
unlink(storage_path('app/private/media/') . $filename);
|
|
|
|
|
$this->removeDirIfEmpty(storage_path('app/private/media'));
|
2020-08-15 09:56:33 +01:00
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function media_endpoint_upload_requires_file(): void
|
2022-05-14 17:44:14 +01:00
|
|
|
|
{
|
|
|
|
|
$response = $this->post(
|
|
|
|
|
'/api/media',
|
|
|
|
|
[],
|
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
|
|
|
|
);
|
|
|
|
|
$response->assertStatus(400);
|
|
|
|
|
$response->assertJson([
|
|
|
|
|
'response' => 'error',
|
|
|
|
|
'error' => 'invalid_request',
|
|
|
|
|
'error_description' => 'No file was sent with the request',
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function error_response_for_unknown_q_value(): void
|
2020-08-15 09:56:33 +01:00
|
|
|
|
{
|
|
|
|
|
$response = $this->get(
|
|
|
|
|
'/api/media?q=unknown',
|
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
|
|
|
|
);
|
|
|
|
|
$response->assertStatus(400);
|
|
|
|
|
$response->assertJson(['error' => 'invalid_request']);
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function options_request_returns_cors_response(): void
|
2020-06-27 14:13:33 +01:00
|
|
|
|
{
|
|
|
|
|
$response = $this->options('/api/media');
|
|
|
|
|
|
|
|
|
|
$response->assertStatus(200);
|
|
|
|
|
$response->assertHeader('access-control-allow-origin', '*');
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function media_endpoint_request_with_invalid_token_returns400_response(): void
|
2020-06-27 14:13:33 +01:00
|
|
|
|
{
|
|
|
|
|
$response = $this->post(
|
|
|
|
|
'/api/media',
|
|
|
|
|
[],
|
|
|
|
|
['HTTP_Authorization' => 'Bearer abc123']
|
|
|
|
|
);
|
|
|
|
|
$response->assertStatus(400);
|
|
|
|
|
$response->assertJsonFragment(['error_description' => 'The provided token did not pass validation']);
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function media_endpoint_request_with_token_with_no_scope_returns400_response(): void
|
2020-06-27 14:13:33 +01:00
|
|
|
|
{
|
|
|
|
|
$response = $this->post(
|
|
|
|
|
'/api/media',
|
|
|
|
|
[],
|
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $this->getTokenWithNoScope()]
|
|
|
|
|
);
|
|
|
|
|
$response->assertStatus(400);
|
|
|
|
|
$response->assertJsonFragment(['error_description' => 'The provided token has no scopes']);
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function media_endpoint_request_with_insufficient_token_scopes_returns401_response(): void
|
2020-06-27 14:13:33 +01:00
|
|
|
|
{
|
|
|
|
|
$response = $this->post(
|
|
|
|
|
'/api/media',
|
|
|
|
|
[],
|
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $this->getTokenWithIncorrectScope()]
|
|
|
|
|
);
|
|
|
|
|
$response->assertStatus(401);
|
|
|
|
|
$response->assertJsonFragment([
|
|
|
|
|
'error_description' => 'The token’s scope does not have the necessary requirements.',
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function media_endpoint_upload_file(): void
|
2020-06-27 14:13:33 +01:00
|
|
|
|
{
|
|
|
|
|
Queue::fake();
|
|
|
|
|
$file = __DIR__ . '/../aaron.png';
|
|
|
|
|
|
|
|
|
|
$response = $this->post(
|
|
|
|
|
'/api/media',
|
|
|
|
|
[
|
|
|
|
|
'file' => new UploadedFile($file, 'aaron.png', 'image/png', null, true),
|
|
|
|
|
],
|
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
|
|
|
|
);
|
|
|
|
|
|
2022-11-10 22:21:02 +00:00
|
|
|
|
$path = parse_url($response->headers->get('Location'), PHP_URL_PATH);
|
2024-10-26 12:52:43 +01:00
|
|
|
|
$filename = Str::chopStart($path, '/storage/');
|
2020-06-27 14:13:33 +01:00
|
|
|
|
Queue::assertPushed(ProcessMedia::class);
|
2024-10-26 12:52:43 +01:00
|
|
|
|
Storage::disk('local')->assertExists($filename);
|
2020-06-27 14:13:33 +01:00
|
|
|
|
// now remove file
|
2025-03-01 15:00:41 +00:00
|
|
|
|
unlink(storage_path('app/private/') . $filename);
|
|
|
|
|
$this->removeDirIfEmpty(storage_path('app/private/media'));
|
2020-06-27 14:13:33 +01:00
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function media_endpoint_upload_audio_file(): void
|
2020-06-27 14:13:33 +01:00
|
|
|
|
{
|
|
|
|
|
Queue::fake();
|
|
|
|
|
$file = __DIR__ . '/../audio.mp3';
|
|
|
|
|
|
|
|
|
|
$response = $this->post(
|
|
|
|
|
'/api/media',
|
|
|
|
|
[
|
|
|
|
|
'file' => new UploadedFile($file, 'audio.mp3', 'audio/mpeg', null, true),
|
|
|
|
|
],
|
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
|
|
|
|
);
|
|
|
|
|
|
2022-11-10 22:21:02 +00:00
|
|
|
|
$path = parse_url($response->headers->get('Location'), PHP_URL_PATH);
|
2024-10-26 12:52:43 +01:00
|
|
|
|
$filename = Str::chopStart($path, '/storage/');
|
2020-06-27 14:13:33 +01:00
|
|
|
|
Queue::assertPushed(ProcessMedia::class);
|
2024-10-26 12:52:43 +01:00
|
|
|
|
Storage::disk('local')->assertExists($filename);
|
2020-06-27 14:13:33 +01:00
|
|
|
|
// now remove file
|
2025-03-01 15:00:41 +00:00
|
|
|
|
unlink(storage_path('app/private/') . $filename);
|
|
|
|
|
$this->removeDirIfEmpty(storage_path('app/private/media'));
|
2020-06-27 14:13:33 +01:00
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function media_endpoint_upload_video_file(): void
|
2020-06-27 14:13:33 +01:00
|
|
|
|
{
|
|
|
|
|
Queue::fake();
|
|
|
|
|
$file = __DIR__ . '/../video.ogv';
|
|
|
|
|
|
|
|
|
|
$response = $this->post(
|
|
|
|
|
'/api/media',
|
|
|
|
|
[
|
|
|
|
|
'file' => new UploadedFile($file, 'video.ogv', 'video/ogg', null, true),
|
|
|
|
|
],
|
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
|
|
|
|
);
|
|
|
|
|
|
2022-11-10 22:21:02 +00:00
|
|
|
|
$path = parse_url($response->headers->get('Location'), PHP_URL_PATH);
|
2024-10-26 12:52:43 +01:00
|
|
|
|
$filename = Str::chopStart($path, '/storage/');
|
2020-06-27 14:13:33 +01:00
|
|
|
|
Queue::assertPushed(ProcessMedia::class);
|
2024-10-26 12:52:43 +01:00
|
|
|
|
Storage::disk('local')->assertExists($filename);
|
2020-06-27 14:13:33 +01:00
|
|
|
|
// now remove file
|
2025-03-01 15:00:41 +00:00
|
|
|
|
unlink(storage_path('app/private/') . $filename);
|
|
|
|
|
$this->removeDirIfEmpty(storage_path('app/private/media'));
|
2020-06-27 14:13:33 +01:00
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function media_endpoint_upload_document_file(): void
|
2020-06-27 14:13:33 +01:00
|
|
|
|
{
|
|
|
|
|
Queue::fake();
|
|
|
|
|
|
|
|
|
|
$response = $this->post(
|
|
|
|
|
'/api/media',
|
|
|
|
|
[
|
|
|
|
|
'file' => UploadedFile::fake()->create('document.pdf', 100),
|
|
|
|
|
],
|
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
|
|
|
|
);
|
|
|
|
|
|
2022-11-10 22:21:02 +00:00
|
|
|
|
$path = parse_url($response->headers->get('Location'), PHP_URL_PATH);
|
2024-10-26 12:52:43 +01:00
|
|
|
|
$filename = Str::chopStart($path, '/storage/');
|
2020-06-27 14:13:33 +01:00
|
|
|
|
Queue::assertPushed(ProcessMedia::class);
|
2024-10-26 12:52:43 +01:00
|
|
|
|
Storage::disk('local')->assertExists($filename);
|
2020-06-27 14:13:33 +01:00
|
|
|
|
// now remove file
|
2025-03-01 15:00:41 +00:00
|
|
|
|
unlink(storage_path('app/private/') . $filename);
|
|
|
|
|
$this->removeDirIfEmpty(storage_path('app/private/media'));
|
2020-06-27 14:13:33 +01:00
|
|
|
|
}
|
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
|
public function media_endpoint_upload_invalid_file_returns_error(): void
|
2020-06-27 14:13:33 +01:00
|
|
|
|
{
|
|
|
|
|
Queue::fake();
|
|
|
|
|
Storage::fake('local');
|
|
|
|
|
|
|
|
|
|
$response = $this->post(
|
|
|
|
|
'/api/media',
|
|
|
|
|
[
|
|
|
|
|
'file' => new UploadedFile(
|
|
|
|
|
__DIR__ . '/../aaron.png',
|
|
|
|
|
'aaron.png',
|
|
|
|
|
'image/png',
|
|
|
|
|
UPLOAD_ERR_INI_SIZE,
|
|
|
|
|
true
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
|
|
|
|
);
|
|
|
|
|
$response->assertStatus(400);
|
|
|
|
|
$response->assertJson(['error_description' => 'The uploaded file failed validation']);
|
|
|
|
|
}
|
|
|
|
|
}
|