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

U2fSubscriberTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 12
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\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