@@ 15-25 (lines=11) @@ | ||
12 | class SimpleBasicAuthTest extends TestCase |
|
13 | { |
|
14 | /** @test */ |
|
15 | public function it_should_return_access_denied_on_empty_credentials() |
|
16 | { |
|
17 | config()->set('auth.simple', [ |
|
18 | 'enabled' => true, |
|
19 | 'user' => 'testuser', |
|
20 | 'password' => 'testpass', |
|
21 | ]); |
|
22 | ||
23 | $response = $this->call('GET', 'url1', [], [], [], []); |
|
24 | $response->assertStatus(401); |
|
25 | } |
|
26 | ||
27 | /** @test */ |
|
28 | public function it_should_return_access_denied_on_wrong_credentials() |
|
@@ 41-52 (lines=12) @@ | ||
38 | } |
|
39 | ||
40 | /** @test */ |
|
41 | public function it_should_return_ok_on_disabled_auth() |
|
42 | { |
|
43 | config()->set('auth.simple', [ |
|
44 | 'enabled' => false, |
|
45 | 'user' => 'testuser', |
|
46 | 'password' => 'testpass', |
|
47 | ]); |
|
48 | ||
49 | $response = $this->call('GET', 'url1', [], [], [], []); |
|
50 | $response->assertStatus(200); |
|
51 | $response->assertSeeText('ok'); |
|
52 | } |
|
53 | ||
54 | /** @test */ |
|
55 | public function it_should_return_ok_with_credentials() |