3 namespace Tests\Commands;
5 use BookStack\Entities\Models\Page;
6 use Illuminate\Support\Facades\DB;
9 class RegenerateReferencesCommandTest extends TestCase
11 public function test_regenerate_references_command()
13 $page = $this->entities->page();
16 $page->html = '<a href="' . $book->getUrl() . '">Book Link</a>';
19 DB::table('references')->delete();
21 $this->artisan('bookstack:regenerate-references')
24 $this->assertDatabaseHas('references', [
25 'from_id' => $page->id,
26 'from_type' => $page->getMorphClass(),
28 'to_type' => $book->getMorphClass(),