mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Add docker development environment
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
<?php namespace Tests;
|
||||
|
||||
use BookStack\Auth\User;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Notifications\ConfirmEmail;
|
||||
use BookStack\Auth\User;
|
||||
use BookStack\Settings\SettingService;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
|
||||
@ -276,6 +276,15 @@ class AuthTest extends BrowserKitTest
|
||||
public function test_user_cannot_be_deleted_if_last_admin()
|
||||
{
|
||||
$adminRole = \BookStack\Auth\Role::getRole('admin');
|
||||
|
||||
// Delete all but one admin user if there are more than one
|
||||
$adminUsers = $adminRole->users;
|
||||
if (count($adminUsers) > 1) {
|
||||
foreach ($adminUsers->splice(1) as $user) {
|
||||
$user->delete();
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure we currently only have 1 admin user
|
||||
$this->assertEquals(1, $adminRole->users()->count());
|
||||
$user = $adminRole->users->first();
|
||||
|
Reference in New Issue
Block a user