|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Gember\RdbmsEventStoreDoctrineDbal\Test\Saga\TableSchema; |
|
6
|
|
|
|
|
7
|
|
|
use Gember\RdbmsEventStoreDoctrineDbal\Saga\TableSchema\SagaTableSchemaFactory; |
|
|
|
|
|
|
8
|
|
|
use PHPUnit\Framework\TestCase; |
|
9
|
|
|
use PHPUnit\Framework\Attributes\Test; |
|
|
|
|
|
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* @internal |
|
13
|
|
|
*/ |
|
14
|
|
|
final class SagaTableSchemaFactoryTest extends TestCase |
|
15
|
|
|
{ |
|
16
|
|
|
#[Test] |
|
17
|
|
|
public function itShouldCreateDefaultSagaStoreTableSchema(): void |
|
18
|
|
|
{ |
|
19
|
|
|
$schema = SagaTableSchemaFactory::createDefaultSagaStore(); |
|
20
|
|
|
|
|
21
|
|
|
self::assertSame('saga_store', $schema->tableName); |
|
22
|
|
|
self::assertSame('id', $schema->idFieldName); |
|
23
|
|
|
self::assertSame('saga_name', $schema->sagaNameFieldName); |
|
24
|
|
|
self::assertSame('payload', $schema->payloadFieldName); |
|
25
|
|
|
self::assertSame('created_at', $schema->createdAtFieldName); |
|
26
|
|
|
self::assertSame('Y-m-d H:i:s.u', $schema->createdAtFieldFormat); |
|
27
|
|
|
self::assertSame('updated_at', $schema->updatedAtFieldName); |
|
28
|
|
|
self::assertSame('Y-m-d H:i:s.u', $schema->updatedAtFieldFormat); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
#[Test] |
|
32
|
|
|
public function itShouldCreateCustomSagaStoreTableSchema(): void |
|
33
|
|
|
{ |
|
34
|
|
|
$schema = SagaTableSchemaFactory::createDefaultSagaStore( |
|
35
|
|
|
'custom_saga_store', |
|
36
|
|
|
'custom_id', |
|
37
|
|
|
'custom_saga_name', |
|
38
|
|
|
'custom_payload', |
|
39
|
|
|
'custom_created_at', |
|
40
|
|
|
'custom_created_at_format', |
|
41
|
|
|
'custom_updated_at', |
|
42
|
|
|
'custom_updated_at_format', |
|
43
|
|
|
); |
|
44
|
|
|
|
|
45
|
|
|
self::assertSame('custom_saga_store', $schema->tableName); |
|
46
|
|
|
self::assertSame('custom_id', $schema->idFieldName); |
|
47
|
|
|
self::assertSame('custom_saga_name', $schema->sagaNameFieldName); |
|
48
|
|
|
self::assertSame('custom_payload', $schema->payloadFieldName); |
|
49
|
|
|
self::assertSame('custom_created_at', $schema->createdAtFieldName); |
|
50
|
|
|
self::assertSame('custom_created_at_format', $schema->createdAtFieldFormat); |
|
51
|
|
|
self::assertSame('custom_updated_at', $schema->updatedAtFieldName); |
|
52
|
|
|
self::assertSame('custom_updated_at_format', $schema->updatedAtFieldFormat); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
#[Test] |
|
56
|
|
|
public function itShouldCreateDefaultSagaStoreRelationTableSchema(): void |
|
57
|
|
|
{ |
|
58
|
|
|
$schema = SagaTableSchemaFactory::createDefaultSagaStoreRelation(); |
|
59
|
|
|
|
|
60
|
|
|
self::assertSame('saga_store_relation', $schema->tableName); |
|
61
|
|
|
self::assertSame('id', $schema->idFieldName); |
|
62
|
|
|
self::assertSame('saga_id', $schema->sagaIdFieldName); |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
#[Test] |
|
66
|
|
|
public function itShouldCreateCustomSagaStoreRelationTableSchema(): void |
|
67
|
|
|
{ |
|
68
|
|
|
$schema = SagaTableSchemaFactory::createDefaultSagaStoreRelation( |
|
69
|
|
|
'custom_saga_store', |
|
70
|
|
|
'custom_id', |
|
71
|
|
|
'custom_saga_id', |
|
72
|
|
|
); |
|
73
|
|
|
|
|
74
|
|
|
self::assertSame('custom_saga_store', $schema->tableName); |
|
75
|
|
|
self::assertSame('custom_id', $schema->idFieldName); |
|
76
|
|
|
self::assertSame('custom_saga_id', $schema->sagaIdFieldName); |
|
77
|
|
|
} |
|
78
|
|
|
} |
|
79
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths