X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/265f5db03f3f08665bb113191f83c49e5dae53a7..refs/pull/5052/head:/tests/OpenGraphTest.php diff --git a/tests/OpenGraphTest.php b/tests/OpenGraphTest.php index 653f2e57e..545fa4c86 100644 --- a/tests/OpenGraphTest.php +++ b/tests/OpenGraphTest.php @@ -1,21 +1,17 @@ -first(); + $page = $this->entities->page(); $resp = $this->asEditor()->get($page->getUrl()); $tags = $this->getOpenGraphTags($resp); @@ -26,7 +22,7 @@ class OpenGraphTest extends TestCase public function test_chapter_tags() { - $chapter = Chapter::query()->first(); + $chapter = $this->entities->chapter(); $resp = $this->asEditor()->get($chapter->getUrl()); $tags = $this->getOpenGraphTags($resp); @@ -37,7 +33,7 @@ class OpenGraphTest extends TestCase public function test_book_tags() { - $book = Book::query()->first(); + $book = $this->entities->book(); $resp = $this->asEditor()->get($book->getUrl()); $tags = $this->getOpenGraphTags($resp); @@ -48,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); @@ -57,7 +53,7 @@ class OpenGraphTest extends TestCase public function test_shelf_tags() { - $shelf = Bookshelf::query()->first(); + $shelf = $this->entities->shelf(); $resp = $this->asEditor()->get($shelf->getUrl()); $tags = $this->getOpenGraphTags($resp); @@ -67,8 +63,8 @@ class OpenGraphTest extends TestCase $this->assertArrayNotHasKey('image', $tags); // Test image set if image has cover image - $shelfRepo = app(BookshelfRepo::class); - $shelfRepo->updateCoverImage($shelf, $this->getTestImage('image.png')); + $baseRepo = app(BaseRepo::class); + $baseRepo->updateCoverImage($shelf, $this->files->uploadedImage('image.png')); $resp = $this->asEditor()->get($shelf->getUrl()); $tags = $this->getOpenGraphTags($resp); @@ -97,6 +93,4 @@ class OpenGraphTest extends TestCase return $tags; } - - -} \ No newline at end of file +}