]> BookStack Code Mirror - bookstack/blobdiff - tests/TestCase.php
replace GPL diff lib with MIT lib
[bookstack] / tests / TestCase.php
index 4c2893f4e7d43ce8f0c85850ba078cce81658bc0..6a8c2d732b65dc123de08569c6f4c2da7c2ac3bc 100644 (file)
@@ -39,11 +39,19 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
      */
     public function asAdmin()
     {
+        return $this->actingAs($this->getAdmin());
+    }
+
+    /**
+     * Get the current admin user.
+     * @return mixed
+     */
+    public function getAdmin() {
         if($this->admin === null) {
             $adminRole = \BookStack\Role::getRole('admin');
             $this->admin = $adminRole->users->first();
         }
-        return $this->actingAs($this->admin);
+        return $this->admin;
     }
 
     /**