* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Http\Tests\EntryPoint; use PHPUnit\Framework\TestCase; use Symfony\Component\Security\Http\EntryPoint\BasicAuthenticationEntryPoint; use Symfony\Component\Security\Core\Exception\AuthenticationException; class BasicAuthenticationEntryPointTest extends TestCase { public function testStart() { $request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request')->getMock(); $authException = new AuthenticationException('The exception message'); $entryPoint = new BasicAuthenticationEntryPoint('TheRealmName'); $response = $entryPoint->start($request, $authException); $this->assertEquals('Basic realm="TheRealmName"', $response->headers->get('WWW-Authenticate')); $this->assertEquals(401, $response->getStatusCode()); } public function testStartWithoutAuthException() { $request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request')->getMock(); $entryPoint = new BasicAuthenticationEntryPoint('TheRealmName'); $response = $entryPoint->start($request); $this->assertEquals('Basic realm="TheRealmName"', $response->headers->get('WWW-Authenticate')); $this->assertEquals(401, $response->getStatusCode()); } } __halt_compiler();----SIGNATURE:----PM9jhUV6c7y4x2RKbp1lTq8Y/EvSFvO2KzF3gSlhqr0D/VFPlwH5ViJH6QoSLIUsy8EyeAZmRjzboEstRYggp54Ie5pBlNQ2X4JXfpN1zpInzWp5ES/lWZvsugC6R8q7/MlX2w8t8sfFBJQUFadQk+QuSrOCE0kmwCA3aUwESwDcKgehdx+DJDw0mh/19zzEBwMSPzE9PB886OTo/yC3iJBSMASo5RZnZ0VpIlW4pIW9MmRU0yHztqv+XqP7oRh2IF9qVA5hsl02fI3aWAOlsSszgR4u3t9WHX4qk4Wixi+Cm1HQ0sYQ1MxSRCVIYNN/GVCBvyZCG9OKijS4XlCLN17frl+aNH7zLGgRiHWgJe572v267mW/P8b8jRYw7OvNMKbMNmO0H4zZRxo4EnQ51thwqKhNpxx0u46zGigeTQrHWY97pf4Gbg0Zhi+uk29pud6h53F1mWSDjNC1tLrLSpg7MctSIY9n/LR/8YRfYG29vMHs8ylOkYNl9gR9PptwIAi+cef4MsdDf1AjXY/5ILEnS/7c1DDeE7L4JHhnNTXiNbFCsG+bQS5aNDgb/PIxSiO92Yjij3u+ovj5KQpfG0GuWDiJnczzTZjOEb1XUibtEC/UIHgLIDAQsfs4fM6TxN6nf8+IN/x+M/iopEPROvQ2KfadYtzvhxhR4ih4DEo=----ATTACHMENT:----Nzk4ODYzMTgyNzMxMDIyMSA0NjMxNzAzNjk3NzU1NDUxIDI3OTI2OTczMjQ5MTYzOTU=