itShouldCreateRdbmsEvent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 13
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 17
rs 9.8333
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gember\RdbmsEventStoreDoctrineDbal\Test;
6
7
use Gember\RdbmsEventStoreDoctrineDbal\DoctrineDbalRdbmsEventFactory;
0 ignored issues
show
Bug introduced by
The type Gember\RdbmsEventStoreDo...neDbalRdbmsEventFactory was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use PHPUnit\Framework\Attributes\Test;
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\Attributes\Test was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use PHPUnit\Framework\TestCase;
10
use DateTimeImmutable;
11
12
/**
13
 * @internal
14
 */
15
final class DoctrineDbalRdbmsEventFactoryTest extends TestCase
16
{
17
    #[Test]
18
    public function itShouldCreateRdbmsEvent(): void
19
    {
20
        $event = (new DoctrineDbalRdbmsEventFactory())->createFromRow([
21
            'eventId' => '5e3ce06e-8f08-440e-b7ea-412ac6c3e892',
22
            'eventName' => 'event_name',
23
            'payload' => '{"some":"data"}',
24
            'metadata' => '{"some":"metadata"}',
25
            'appliedAt' => '2018-12-01 12:05:08.234543',
26
            'domainId' => '5f183c87-20c5-412e-8b0f-e8d86c7b7a47',
27
        ]);
28
29
        self::assertSame('5e3ce06e-8f08-440e-b7ea-412ac6c3e892', $event->eventId);
30
        self::assertSame('event_name', $event->eventName);
31
        self::assertSame('{"some":"data"}', $event->payload);
32
        self::assertSame(['some' => 'metadata'], $event->metadata);
33
        self::assertEquals(new DateTimeImmutable('2018-12-01 12:05:08.234543'), $event->appliedAt);
34
    }
35
}
36