| @@ 37-47 (lines=11) @@ | ||
| 34 | } |
|
| 35 | ||
| 36 | /** @test */ |
|
| 37 | public function it_should_return_access_denied_on_wrong_credentials() |
|
| 38 | { |
|
| 39 | config()->set('auth.simple', [ |
|
| 40 | 'enabled' => true, |
|
| 41 | 'user' => 'testuser', |
|
| 42 | 'password' => 'testpass', |
|
| 43 | ]); |
|
| 44 | ||
| 45 | $response = $this->call('GET', 'url1', [], [], [], ['PHP_AUTH_USER' => 'testuser', 'PHP_AUTH_PW' => 'wrongpass']); |
|
| 46 | $response->assertStatus(401); |
|
| 47 | } |
|
| 48 | ||
| 49 | /** @test */ |
|
| 50 | public function it_should_return_ok_on_disabled_auth() |
|
| @@ 64-74 (lines=11) @@ | ||
| 61 | } |
|
| 62 | ||
| 63 | /** @test */ |
|
| 64 | public function it_should_return_ok_with_credentials() |
|
| 65 | { |
|
| 66 | config()->set('auth.simple', [ |
|
| 67 | 'enabled' => true, |
|
| 68 | 'user' => 'testuser', |
|
| 69 | 'password' => 'testpass', |
|
| 70 | ]); |
|
| 71 | $response = $this->call('GET', 'url1', [], [], [], ['PHP_AUTH_USER' => 'testuser', 'PHP_AUTH_PW' => 'testpass']); |
|
| 72 | $response->assertStatus(200); |
|
| 73 | $response->assertSeeText('ok'); |
|
| 74 | } |
|
| 75 | ||
| 76 | } |
|
| 77 | ||