first(); $book = $page->book; $page->html = 'Book Link'; $page->save(); DB::table('references')->delete(); $this->artisan('bookstack:regenerate-references') ->assertExitCode(0); $this->assertDatabaseHas('references', [ 'from_id' => $page->id, 'from_type' => $page->getMorphClass(), 'to_id' => $book->id, 'to_type' => $book->getMorphClass(), ]); } }