Completed
Push — master ( 4db7eb...1374e0 )
by michael
02:48
created

testFailureCounter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the U2F Security bundle.
5
 *
6
 * (c) Michael Barbey <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Mbarbey\U2fSecurityBundle\Tests\Event\Authentication;
13
14
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
15
use Mbarbey\U2fSecurityBundle\Event\Authentication\U2fAuthenticationFailureEvent;
16
use Mbarbey\U2fSecurityBundle\Model\User\U2fUser;
17
18
class U2fAuthenticationFailureEventTest extends TestCase
19
{
20
    private $event;
21
    private $user;
22
    private $error;
23
24
    public function setUp()
25
    {
26
        $this->user = new U2fUser();
27
        $this->error = new \Exception();
28
29
        $this->event = new U2fAuthenticationFailureEvent($this->user, $this->error, 33);
30
    }
31
32
    public function testName()
33
    {
34
        $this->assertEquals('u2f.authentication.failure', U2fAuthenticationFailureEvent::getName());
35
        $this->assertEquals('u2f.authentication.failure', $this->event->getName());
36
    }
37
38
    public function testUser()
39
    {
40
        $this->assertEquals($this->user, $this->event->getUser());
41
    }
42
43
    public function testError()
44
    {
45
        $this->assertEquals($this->error, $this->event->getError());
46
    }
47
48
    public function testFailureCounter()
49
    {
50
        $this->assertEquals(33, $this->event->getFailureCounter());
51
    }
52
}
53