]> BookStack Code Mirror - bookstack/blobdiff - tests/References/CrossLinkParserTest.php
Perms: Fixed some issues made when adding transactions
[bookstack] / tests / References / CrossLinkParserTest.php
index 42d78cb0a0b99370fc8567c340c6881170d2dcaa..65eed9e70fc2a168b8e799e1492203ddfc98fd89 100644 (file)
@@ -2,22 +2,19 @@
 
 namespace Tests\References;
 
-use BookStack\Entities\Models\Book;
-use BookStack\Entities\Models\Page;
 use BookStack\References\CrossLinkParser;
 use Tests\TestCase;
 
 class CrossLinkParserTest extends TestCase
 {
-
     public function test_instance_with_entity_resolvers_matches_entity_links()
     {
-        $entities = $this->getEachEntityType();
-        $otherPage = Page::query()->where('id', '!=', $entities['page']->id)->first();
+        $entities = $this->entities->all();
+        $otherPage = $this->entities->page();
 
         $html = '
 <a href="' . url('/link/' . $otherPage->id) . '#cat">Page Permalink</a>
-<a href="' . $entities['page'] ->getUrl(). '?a=b">Page Link</a>
+<a href="' . $entities['page']->getUrl() . '?a=b">Page Link</a>
 <a href="' . $entities['chapter']->getUrl() . '?cat=mouse#donkey">Chapter Link</a>
 <a href="' . $entities['book']->getUrl() . '/edit">Book Link</a>
 <a href="' . $entities['bookshelf']->getUrl() . '/edit?cat=happy#hello">Shelf Link</a>
@@ -42,7 +39,7 @@ class CrossLinkParserTest extends TestCase
 
     public function test_similar_page_and_book_reference_links_dont_conflict()
     {
-        $page = Page::query()->first();
+        $page = $this->entities->page();
         $book = $page->book;
 
         $html = '