Skip to content

Commit 05ba980

Browse files
committed
add test when wrong headers are sent
1 parent 10ba621 commit 05ba980

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/Unit/Support/BasicAuthTest.php

+12
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ public function it_will_fail_if_invalid_credentials()
4040
Assert::assertFalse($this->service->checkBasic($request, 'user', 'pass'));
4141
}
4242

43+
/** @test */
44+
public function it_will_fail_if_invalid_headers()
45+
{
46+
$request = $this->request();
47+
$request->headers->add([
48+
'PHP-AUTH-USER' => 'user',
49+
'PHP-AUTH-PASS' => 'pass',
50+
]);
51+
52+
Assert::assertFalse($this->service->checkBasic($request, 'user', 'pass'));
53+
}
54+
4355
/** @test */
4456
public function it_will_pass_if_correct_credentials()
4557
{

0 commit comments

Comments
 (0)