-<?php namespace Tests\Commands;
+<?php
+
+namespace Tests\Commands;
use BookStack\Auth\User;
use Tests\TestCase;
public function test_add_admin_command()
{
$exitCode = \Artisan::call('bookstack:create-admin', [
- '--name' => 'Admin Test',
+ '--name' => 'Admin Test',
'--password' => 'testing-4',
]);
$this->assertTrue($exitCode === 0, 'Command executed successfully');
$this->assertDatabaseHas('users', [
- 'name' => 'Admin Test'
+ 'name' => 'Admin Test',
]);
$this->assertTrue(User::query()->where('email', '=', '
[email protected]')->first()->hasSystemRole('admin'), 'User has admin role as expected');
$this->assertTrue(\Auth::attempt(['email' => '
[email protected]', 'password' => 'testing-4']), 'Password stored as expected');
}
-}
\ No newline at end of file
+}