Passed
Pull Request — main (#86)
by Jeroen
02:09
created

itShouldCreateRdbmsSaga()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 12
nc 1
nop 0
dl 0
loc 16
rs 9.8666
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gember\RdbmsEventStoreDoctrineDbal\Test\Saga;
6
7
use Gember\RdbmsEventStoreDoctrineDbal\Saga\DoctrineDbalRdbmsSagaFactory;
0 ignored issues
show
Bug introduced by
The type Gember\RdbmsEventStoreDo...ineDbalRdbmsSagaFactory 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\TestCase;
9
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...
10
use DateTimeImmutable;
11
12
/**
13
 * @internal
14
 */
15
final class DoctrineDbalRdbmsSagaFactoryTest extends TestCase
16
{
17
    #[Test]
18
    public function itShouldCreateRdbmsSaga(): void
19
    {
20
        $saga = (new DoctrineDbalRdbmsSagaFactory())->createFromRow([
21
            'sagaName' => 'some.saga',
22
            'sagaId' => '01K76G1PGKPZ047KDN25PFPEEV',
23
            'payload' => '{"some":"data"}',
24
            'createdAt' => '2018-12-01 12:05:08.234543',
25
            'updatedAt' => null,
26
        ]);
27
28
        self::assertSame('some.saga', $saga->sagaName);
29
        self::assertSame('01K76G1PGKPZ047KDN25PFPEEV', $saga->sagaId);
30
        self::assertSame('{"some":"data"}', $saga->payload);
31
        self::assertEquals(new DateTimeImmutable('2018-12-01 12:05:08.234543'), $saga->createdAt);
32
        self::assertNull($saga->updatedAt);
33
    }
34
}
35