mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-28 19:06:39 +08:00
Fixed error on image deletion
Also Added tests to cover image upload and deletion. Fixes #136.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user