i write test like this
$response = $this->actingAs(\App\Models\User::first())
->post(route('profile-menu.update', $profile), [
'image' => UploadedFile::fake()->image('avatar.jpg', 900, 500)->size(100),
'profile' => [
'en' => [
'title' => 'test',
'description' => 'test'
],
'id' => [
'title' => 'test',
'description' => 'test'
]
]
]);
print_r($response->decodeResponseJson());
$response->assertStatus(302);
and i import the requirement in top of my controller
namespace App\Http\Controllers\Admin;
use File;
use Image;
use Storage;
i already register the Intervention service provider and write alias for it.
the test result is
1) Tests\Feature\MyTest::testUpdateProfileDetail
Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined method Image::make()
/opt/atlassian/pipelines/agent/build/app/Http/Controllers/Admin/ProfileMenuController.php:72
i can't figure it out how is Image::make() not recognized by phpunit, is there any problem with my script or its a bug from pipelining service?