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.

MapBasedEventsHandlerTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 13
c 1
b 0
f 0
dl 0
loc 30
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUpDependencies() 0 6 1
A testOutboxHappyPathWorkflowOnFlushEvent() 0 13 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dsantang\DomainEventsDoctrine\Tests\Integration;
6
7
use Doctrine\ORM\EntityManagerInterface;
8
use Doctrine\ORM\UnitOfWork;
9
use Dsantang\DomainEventsDoctrine\Outbox\MapBased;
10
use Dsantang\DomainEventsDoctrine\Tests\OutboxSubClass;
11
use Dsantang\DomainEventsDoctrine\Tests\Unit\Outbox\EventArgsProvider;
12
use Dsantang\DomainEventsDoctrine\Tests\Unit\Outbox\Stub\Converters\FirstOutboxConverter;
13
use Dsantang\DomainEventsDoctrine\Tests\Unit\Outbox\Stub\DomainEvents\FirstDomainEvent;
14
use PHPUnit\Framework\TestCase;
15
16
final class MapBasedEventsHandlerTest extends TestCase
17
{
18
    use EventArgsProvider;
19
20
    private MapBased $mapBasedEventsHandler;
21
22
    /**
23
     * @before
24
     */
25
    public function setUpDependencies(): void
26
    {
27
        $this->mapBasedEventsHandler = new MapBased(new OutboxSubClass());
28
29
        $this->entityManager = $this->createMock(EntityManagerInterface::class);
30
        $this->unitOfWork    = $this->createMock(UnitOfWork::class);
31
    }
32
33
    public function testOutboxHappyPathWorkflowOnFlushEvent(): void
34
    {
35
        $this->mapBasedEventsHandler->addConverter(
36
            FirstDomainEvent::class,
37
            new FirstOutboxConverter()
38
        );
39
40
        $eventArgs = $this->getEventArgs();
41
42
        $this->entityManager->expects(self::once())->method('persist');
43
        $this->unitOfWork->expects(self::once())->method('computeChangeSets');
44
45
        $this->mapBasedEventsHandler->onFlush($eventArgs);
46
    }
47
}
48