1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

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

@@ -6,12 +6,10 @@ use BookStack\Entities\Models\Book;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
use Tests\Uploads\UsesImages;
class BooksApiTest extends TestCase
{
use TestsApi;
use UsesImages;
protected string $baseEndpoint = '/api/books';
@@ -157,7 +155,7 @@ class BooksApiTest extends TestCase
/** @var Book $book */
$book = $this->entities->book();
$this->assertNull($book->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 . "/{$book->id}", [