Completed
Push — master ( 450ed3...cc0280 )
by michael
02:49
created

U2fRegistrationFailureEventTest::testUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 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\Registration;
13
14
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
15
use Mbarbey\U2fSecurityBundle\Model\User\U2fUser;
16
use Mbarbey\U2fSecurityBundle\Event\Registration\U2fRegistrationFailureEvent;
17
18
class U2fRegistrationFailureEventTest extends TestCase
19
{
20
    private $event;
21
    private $user;
22
    private $error;
23
24
    public function setUp()
25
    {
26
        $this->user = $this->getMockForAbstractClass(U2fUser::class);
27
        $this->error = new \Exception();
28
29
        $this->event = new U2fRegistrationFailureEvent($this->user, $this->error);
30
    }
31
32
    public function testName()
33
    {
34
        $name = 'u2f.registration.failure';
35
36
        $this->assertEquals(U2fRegistrationFailureEvent::getName(), $name);
37
        $this->assertEquals($this->event->getName(), $name);
38
    }
39
40
    public function testUser()
41
    {
42
        $this->assertEquals($this->event->getUser(), $this->user);
43
    }
44
45
    public function testError()
46
    {
47
        $this->assertEquals($this->event->getError(), $this->error);
48
    }
49
}
50