GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

DoctrineEventsDispatcherTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 16
c 1
b 0
f 0
dl 0
loc 29
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A postFlushShouldDispatchAllEvents() 0 22 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dsantang\DomainEventsDoctrine\Tests\Unit\Dispatcher;
6
7
use Dsantang\DomainEvents\DomainEvent;
8
use Dsantang\DomainEventsDoctrine\Dispatcher\SimpleEventsDispatcher;
9
use Dsantang\DomainEventsDoctrine\Dispatcher\SymfonyEvent;
10
use Dsantang\DomainEventsDoctrine\Releaser;
11
use PHPUnit\Framework\TestCase;
12
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
13
14
final class DoctrineEventsDispatcherTest extends TestCase
15
{
16
    private const EVENT_NAME = 'OrderDispatched';
17
18
    /**
19
     * @test
20
     */
21
    public function postFlushShouldDispatchAllEvents(): void
22
    {
23
        $domainEvent = $this->createMock(DomainEvent::class);
24
        $domainEvent->expects(self::once())
25
                    ->method('getName')
26
                    ->willReturn(self::EVENT_NAME);
27
28
        $releaser = $this->createMock(Releaser::class);
29
30
        $releaser->expects(self::once())
31
                 ->method('release')
32
                 ->willReturn([$domainEvent]);
33
34
        $dispatcher = $this->createMock(EventDispatcherInterface::class);
35
36
        $dispatcher->expects(self::once())
37
                   ->method('dispatch')
38
                   ->with(self::isInstanceOf(SymfonyEvent::class), self::EVENT_NAME);
39
40
        $eventDispatcher = new SimpleEventsDispatcher($releaser, $dispatcher);
41
42
        $eventDispatcher->postFlush();
43
    }
44
}
45