Extracted test file handling to its own class

Closes #3995
This commit is contained in:
Dan Brown
2023-02-08 14:39:13 +00:00
parent 5d18e7df79
commit da1a66abd3
17 changed files with 293 additions and 309 deletions

View File

@ -7,12 +7,10 @@ use BookStack\Entities\Models\Bookshelf;
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';
@ -154,7 +152,7 @@ class ShelvesApiTest extends TestCase
/** @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}", [