]> BookStack Code Mirror - bookstack/blobdiff - tests/Uploads/AttachmentTest.php
Update settings.php
[bookstack] / tests / Uploads / AttachmentTest.php
index 0d51e050fa6c421c4d6593e94570687055f42a49..e98a90b35d2034aaa701a726a42fcb5de4939b30 100644 (file)
@@ -1,8 +1,9 @@
-<?php namespace Tests;
+<?php namespace Tests\Uploads;
 
 use BookStack\Uploads\Attachment;
 use BookStack\Entities\Page;
 use BookStack\Auth\Permissions\PermissionService;
+use Tests\TestCase;
 
 class AttachmentTest extends TestCase
 {
@@ -223,7 +224,7 @@ class AttachmentTest extends TestCase
     {
         $admin = $this->getAdmin();
         $viewer = $this->getViewer();
-        $page = Page::first();
+        $page = Page::first(); /** @var Page $page */
 
         $this->actingAs($admin);
         $fileName = 'permission_test.txt';
@@ -233,7 +234,7 @@ class AttachmentTest extends TestCase
         $page->restricted = true;
         $page->permissions()->delete();
         $page->save();
-        $this->app[PermissionService::class]->buildJointPermissionsForEntity($page);
+        $page->rebuildPermissions();
         $page->load('jointPermissions');
 
         $this->actingAs($viewer);