]> BookStack Code Mirror - bookstack/blobdiff - tests/Commands/RegenerateReferencesCommandTest.php
respective book and chapter structure added.
[bookstack] / tests / Commands / RegenerateReferencesCommandTest.php
index 8906474af03b8b74a17ff55f80db79be879d4d4e..36af0d7ccddb37467c2e3ff35468d4b2cbdada64 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace Tests\Commands;
 
-use BookStack\Entities\Models\Page;
 use Illuminate\Support\Facades\DB;
 use Tests\TestCase;
 
@@ -10,8 +9,7 @@ class RegenerateReferencesCommandTest extends TestCase
 {
     public function test_regenerate_references_command()
     {
-        /** @var Page $page */
-        $page = Page::query()->first();
+        $page = $this->entities->page();
         $book = $page->book;
 
         $page->html = '<a href="' . $book->getUrl() . '">Book Link</a>';
@@ -23,10 +21,10 @@ class RegenerateReferencesCommandTest extends TestCase
             ->assertExitCode(0);
 
         $this->assertDatabaseHas('references', [
-            'from_id' => $page->id,
+            'from_id'   => $page->id,
             'from_type' => $page->getMorphClass(),
-            'to_id' => $book->id,
-            'to_type' => $book->getMorphClass(),
+            'to_id'     => $book->id,
+            'to_type'   => $book->getMorphClass(),
         ]);
     }
 }