@@ 28-38 (lines=11) @@ | ||
25 | } |
|
26 | ||
27 | /** @test */ |
|
28 | public function it_should_return_access_denied_on_wrong_credentials() |
|
29 | { |
|
30 | config()->set('auth.simple', [ |
|
31 | 'enabled' => true, |
|
32 | 'user' => 'testuser', |
|
33 | 'password' => 'testpass', |
|
34 | ]); |
|
35 | ||
36 | $response = $this->call('GET', 'url1', [], [], [], ['PHP_AUTH_USER' => 'testuser', 'PHP_AUTH_PW' => 'wrongpass']); |
|
37 | $response->assertStatus(401); |
|
38 | } |
|
39 | ||
40 | /** @test */ |
|
41 | public function it_should_return_ok_on_disabled_auth() |
|
@@ 55-65 (lines=11) @@ | ||
52 | } |
|
53 | ||
54 | /** @test */ |
|
55 | public function it_should_return_ok_with_credentials() |
|
56 | { |
|
57 | config()->set('auth.simple', [ |
|
58 | 'enabled' => true, |
|
59 | 'user' => 'testuser', |
|
60 | 'password' => 'testpass', |
|
61 | ]); |
|
62 | $response = $this->call('GET', 'url1', [], [], [], ['PHP_AUTH_USER' => 'testuser', 'PHP_AUTH_PW' => 'testpass']); |
|
63 | $response->assertStatus(200); |
|
64 | $response->assertSeeText('ok'); |
|
65 | } |
|
66 | ||
67 | protected function getEnvironmentSetUp($app) |
|
68 | { |