3 class AuthTest extends TestCase
6 public function testAuthWorking()
12 public function testLogin()
17 ->type('password', '#password')
23 public function testPublicViewing()
25 $settings = app('BookStack\Services\SettingService');
26 $settings->put('app-public', 'true');
32 public function testRegistrationShowing()
34 // Ensure registration form is showing
35 $this->setSettings(['registration-enabled' => 'true']);
36 $this->visit('/login')
39 ->seePageIs('/register');
42 public function testNormalRegistration()
44 $this->setSettings(['registration-enabled' => 'true']);
45 $user = factory(\BookStack\User::class)->make();
47 $this->visit('/register')
49 ->type($user->name, '#name')
50 ->type($user->email, '#email')
51 ->type($user->password, '#password')
52 ->press('Create Account')
57 private function setSettings($settingsArray)
59 $settings = app('BookStack\Services\SettingService');
60 foreach($settingsArray as $key => $value) {
61 $settings->put($key, $value);
65 public function testLogout()
72 ->seePageIs('/login');