]> BookStack Code Mirror - bookstack/blobdiff - tests/Actions/WebhookCallTest.php
CM6: Further fixes/improvements after testing
[bookstack] / tests / Actions / WebhookCallTest.php
index d9f9ddad591cd61ea26f5953e22f0bf827b003ae..078b8bdf4beda6a6134e5ff7d673fa8a9de8cd0e 100644 (file)
@@ -7,7 +7,6 @@ use BookStack\Actions\ActivityType;
 use BookStack\Actions\DispatchWebhookJob;
 use BookStack\Actions\Webhook;
 use BookStack\Auth\User;
-use BookStack\Entities\Models\Page;
 use Illuminate\Http\Client\Request;
 use Illuminate\Support\Facades\Bus;
 use Illuminate\Support\Facades\Http;
@@ -88,9 +87,8 @@ class WebhookCallTest extends TestCase
             '*' => Http::response('', 200),
         ]);
         $webhook = $this->newWebhook(['active' => true, 'endpoint' => 'https://wh.example.com'], ['all']);
-        /** @var Page $page */
-        $page = Page::query()->first();
-        $editor = $this->getEditor();
+        $page = $this->entities->page();
+        $editor = $this->users->editor();
 
         $this->runEvent(ActivityType::PAGE_UPDATE, $page, $editor);
 
@@ -113,7 +111,7 @@ class WebhookCallTest extends TestCase
     protected function runEvent(string $event, $detail = '', ?User $user = null)
     {
         if (is_null($user)) {
-            $user = $this->getEditor();
+            $user = $this->users->editor();
         }
 
         $this->actingAs($user);