Skip to content

Commit 57c060b

Browse files
committed
Test for HTTP authentication
1 parent 4457352 commit 57c060b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tests/Igorw/CgiHttpKernel/CgiHttpKernelTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,13 @@ public function isShouldParseMultipleCookiesFromResponse()
157157
$this->assertSame('qux', $cookies[1]->getName());
158158
$this->assertSame('quux', $cookies[1]->getValue());
159159
}
160+
161+
/** @test */
162+
public function itShouldSetHttpAuth()
163+
{
164+
$request = Request::create('http://igorw:secret@localhost/auth.php');
165+
$response = $this->kernel->handle($request);
166+
167+
$this->assertSame('igorw:secret', $response->getContent());
168+
}
160169
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
echo $_SERVER['PHP_AUTH_USER'].':'.$_SERVER['PHP_AUTH_PW'];

0 commit comments

Comments
 (0)