Passed
Branch master (17d5a9)
by michael
08:14
created

U2fSubscriberTest::testSubscribedEvents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 10
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\EventSubscriber;
13
14
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
15
use Mbarbey\U2fSecurityBundle\EventSubscriber\U2fSubscriber;
16
use Symfony\Component\Security\Http\SecurityEvents;
17
use Symfony\Component\HttpKernel\KernelEvents;
18
19
class U2fSubscriberTest extends TestCase
20
{
21
    public function testSubscribedEvents()
22
    {
23
        $events = U2fSubscriber::getSubscribedEvents();
24
25
        $this->assertEquals(count($events), 2);
26
        $this->assertArrayHasKey(SecurityEvents::INTERACTIVE_LOGIN, $events);
27
        $this->assertArrayHasKey(KernelEvents::REQUEST, $events);
28
29
        $this->assertTrue(method_exists(U2fSubscriber::class, $events[SecurityEvents::INTERACTIVE_LOGIN]));
30
        $this->assertTrue(method_exists(U2fSubscriber::class, $events[KernelEvents::REQUEST]));
31
    }
32
}
33