Passed
Pull Request — master (#14)
by Alex
03:52
created

testImplementsEventDispatcherInterface()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 2
c 1
b 1
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ArpTest\EventDispatcher;
6
7
use Arp\EventDispatcher\ImmutableEventDispatcher;
8
use PHPUnit\Framework\MockObject\MockObject;
9
use PHPUnit\Framework\TestCase;
10
use Psr\EventDispatcher\EventDispatcherInterface;
11
use Psr\EventDispatcher\ListenerProviderInterface;
12
13
/**
14
 * @covers \Arp\EventDispatcher\ImmutableEventDispatcher
15
 *
16
 * @author  Alex Patterson <[email protected]>
17
 * @package ArpTest\EventDispatcher
18
 */
19
final class ImmutableEventDispatcherTest extends TestCase
20
{
21
    /**
22
     * @var ListenerProviderInterface|MockObject
23
     */
24
    private $listenerProvider;
25
26
    /**
27
     * Prepare the test case dependencies.
28
     */
29
    public function setUp(): void
30
    {
31
        $this->listenerProvider = $this->getMockForAbstractClass(ListenerProviderInterface::class);
32
    }
33
34
    /**
35
     * Assert that the event dispatcher is an instance of EventDispatcherInterface.
36
     */
37
    public function testImplementsEventDispatcherInterface(): void
38
    {
39
        $eventDispatcher = new ImmutableEventDispatcher($this->listenerProvider);
40
41
        $this->assertInstanceOf(EventDispatcherInterface::class, $eventDispatcher);
42
    }
43
}
44