1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +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

@ -7,12 +7,9 @@ use BookStack\Entities\Models\BookChild;
use BookStack\Entities\Models\Bookshelf;
use BookStack\Entities\Repos\BookRepo;
use Tests\TestCase;
use Tests\Uploads\UsesImages;
class BookTest extends TestCase
{
use UsesImages;
public function test_create()
{
$book = Book::factory()->make([
@ -333,7 +330,7 @@ class BookTest extends TestCase
{
$book = $this->entities->book();
$bookRepo = $this->app->make(BookRepo::class);
$coverImageFile = $this->getTestImage('cover.png');
$coverImageFile = $this->files->uploadedImage('cover.png');
$bookRepo->updateCoverImage($book, $coverImageFile);
$this->asEditor()->post($book->getUrl('/copy'), ['name' => 'My copy book']);