Test Failed
Push — master ( 1374e0...cfebc0 )
by michael
03:12
created

U2fAuthenticationRequiredEventTest::testAbort()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
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\Model\User\U2fUser;
16
use Mbarbey\U2fSecurityBundle\Event\Authentication\U2fAuthenticationRequiredEvent;
17
18
class U2fAuthenticationRequiredEventTest extends TestCase
19
{
20
    private $event;
21
    private $user;
22
23
    public function setUp()
24
    {
25
        $this->user = new U2fUser();
26
27
        $this->event = new U2fAuthenticationRequiredEvent($this->user);
28
    }
29
30
    public function testName()
31
    {
32
        $this->assertEquals('u2f.authentication.required', U2fAuthenticationRequiredEvent::getName());
33
        $this->assertEquals('u2f.authentication.required', $this->event->getName());
34
    }
35
36
    public function testUser()
37
    {
38
        $this->assertEquals($this->user, $this->event->getUser());
39
    }
40
41
    public function testMustAuthenticate()
42
    {
43
        $this->assertTrue($this->event->mustAuthenticate());
44
    }
45
46
    public function testAbort()
47
    {
48
        $this->event->abort();
49
        $this->assertFalse($this->event->mustAuthenticate());
50
    }
51
}
52