* * 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:----kJKJd1A/UZ9gzpFTFacocalHiB4CNPXdqpOBUbw5cHj0f6nw9I0T0hGacWJgYwnKWk7xNe4aMkHgw1XDrMWpTB44CtwzfhmIDBCAzJzMqpXpddRm0t2n3/ric2oSiNQc7RoFkQld7yFay9D2gzCHW06FMSOhgVYk+qXlVKcHAlYOqUhAc06cdPFkncdjO9w38p1ClqztPg2ffm8PRU7y2akHgWKkA8M8NP9XMEF+ctYIBDIk2iEjoaUi6/0aGkvW2LSiugOsmiA0tbfnzZMYBswdLHDtHYdpYuNe8PNyI/awY/6O1N7ddHLIlPl4YFfENV3FxlC0j8Z3iP3mi4xRu4/vpZLTdgdzVZzDrrsQ3X99qSI0IpABRSBM1RHEeZ7QKLR6R4m6t2NKH5pai44R74qHZGy5imjIh27fVHWGnSj4e8X8DuN3469oyRAQo0dbjGBBMpjRttwHTtyDivrkIFzMRsp9CrpYXaTq2DNx3g8tVjvpnVx/CKF9aBx1hw5V+Sa2rZPZE9dfITZU66wVQAi9KpfOIaVPymffsdXlhq5qS979w2n57tW0jbH/vkSrGKHLlFBYRdJvVfnm8ObBrnsmjTSIiCzfZqbDZtPNXqcL9pBdfFHoHrYq5f6z+ahLNqQcUEzx9EY/GRLzodJO1YnSmwgjl4COfA+FEWf2k7g=----ATTACHMENT:----Mjc2NzM4MTE1NzQ5NTIyOCA3Mjc1NDE4NTMzNzA1NDYgNTE0NDM1MTYwNTk5NDcwMA==