use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
-use Tests\Uploads\UsesImages;
class ShelvesApiTest extends TestCase
{
use TestsApi;
- use UsesImages;
protected string $baseEndpoint = '/api/shelves';
/** @var Book $shelf */
$shelf = Bookshelf::visible()->first();
$this->assertNull($shelf->cover);
- $file = $this->getTestImage('image.png');
+ $file = $this->files->uploadedImage('image.png');
// Ensure cover image can be set via API
$resp = $this->call('PUT', $this->baseEndpoint . "/{$shelf->id}", [
// Ensure further updates without image do not clear cover image
$resp = $this->put($this->baseEndpoint . "/{$shelf->id}", [
- 'name' => 'My updated shelf again'
+ 'name' => 'My updated shelf again',
]);
$shelf->refresh();