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

@ -6,12 +6,9 @@ use BookStack\Entities\Repos\BaseRepo;
use BookStack\Entities\Repos\BookRepo;
use Illuminate\Support\Str;
use Illuminate\Testing\TestResponse;
use Tests\Uploads\UsesImages;
class OpenGraphTest extends TestCase
{
use UsesImages;
public function test_page_tags()
{
$page = $this->entities->page();
@ -47,7 +44,7 @@ class OpenGraphTest extends TestCase
// Test image set if image has cover image
$bookRepo = app(BookRepo::class);
$bookRepo->updateCoverImage($book, $this->getTestImage('image.png'));
$bookRepo->updateCoverImage($book, $this->files->uploadedImage('image.png'));
$resp = $this->asEditor()->get($book->getUrl());
$tags = $this->getOpenGraphTags($resp);
@ -67,7 +64,7 @@ class OpenGraphTest extends TestCase
// Test image set if image has cover image
$baseRepo = app(BaseRepo::class);
$baseRepo->updateCoverImage($shelf, $this->getTestImage('image.png'));
$baseRepo->updateCoverImage($shelf, $this->files->uploadedImage('image.png'));
$resp = $this->asEditor()->get($shelf->getUrl());
$tags = $this->getOpenGraphTags($resp);