testOnAuthenticationFailure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the SecurityApiBundle package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace OsLab\SecurityApiBundle\Tests\Security\Authentication;
11
12
use OsLab\SecurityApiBundle\Security\Authentication\AuthenticationFailureHandler;
13
use Symfony\Component\HttpFoundation\Request;
14
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
15
use Symfony\Component\Security\Core\Exception\AuthenticationException;
16
17
/**
18
 * Unit test for the AuthenticationFailureTest.
19
 *
20
 * @author Michael COULLERET <[email protected]>
21
 * @author Florent DESPIERRES <[email protected]>
22
 */
23
class AuthenticationFailureTest extends \PHPUnit_Framework_TestCase
24
{
25
    public function testOnAuthenticationFailure()
26
    {
27
        $this->expectException(AccessDeniedHttpException::class);
28
29
        $authenticationFailureHandler = new AuthenticationFailureHandler();
30
        $authenticationFailureHandler->onAuthenticationFailure(new Request(), new AuthenticationException());
31
    }
32
}
33