]> BookStack Code Mirror - bookstack/blobdiff - tests/User/UserManagementTest.php
Quick run through of applying new test entity helper class
[bookstack] / tests / User / UserManagementTest.php
index f0bc7c2f066bb61a293a588611ec94919eea2c74..e295034ceefb208bc32ebba6280790ef926e69b6 100644 (file)
@@ -6,7 +6,6 @@ use BookStack\Actions\ActivityType;
 use BookStack\Auth\Access\UserInviteService;
 use BookStack\Auth\Role;
 use BookStack\Auth\User;
-use BookStack\Entities\Models\Page;
 use Illuminate\Support\Facades\Hash;
 use Illuminate\Support\Str;
 use Mockery\MockInterface;
@@ -150,7 +149,7 @@ class UserManagementTest extends TestCase
 
     public function test_delete_with_new_owner_id_changes_ownership()
     {
-        $page = Page::query()->first();
+        $page = $this->entities->page();
         $owner = $page->ownedBy;
         $newOwner = User::query()->where('id', '!=', $owner->id)->first();
 
@@ -252,8 +251,8 @@ class UserManagementTest extends TestCase
         // Both on create
         $resp = $this->post('/settings/users/create', [
             'language' => 'en<GB_and_this_is_longer',
-            'name' => 'My name',
-            'email' => '[email protected]',
+            'name'     => 'My name',
+            'email'    => '[email protected]',
         ]);
         $resp->assertSessionHasErrors(['language' => 'The language may not be greater than 15 characters.']);
         $resp->assertSessionHasErrors(['language' => 'The language may only contain letters, numbers, dashes and underscores.']);