1414final class SagaTableSchemaFactoryTest extends TestCase
1515{
1616 #[Test]
17- public function itShouldCreateDefaultEventStoreTableSchema (): void
17+ public function itShouldCreateDefaultSagaStoreTableSchema (): void
1818 {
1919 $ schema = SagaTableSchemaFactory::createDefaultSagaStore ();
2020
2121 self ::assertSame ('saga_store ' , $ schema ->tableName );
22- self ::assertSame ('saga_id ' , $ schema ->sagaIdFieldName );
22+ self ::assertSame ('id ' , $ schema ->idFieldName );
2323 self ::assertSame ('saga_name ' , $ schema ->sagaNameFieldName );
2424 self ::assertSame ('payload ' , $ schema ->payloadFieldName );
2525 self ::assertSame ('created_at ' , $ schema ->createdAtFieldName );
@@ -29,11 +29,11 @@ public function itShouldCreateDefaultEventStoreTableSchema(): void
2929 }
3030
3131 #[Test]
32- public function itShouldCreateCustomEventStoreTableSchema (): void
32+ public function itShouldCreateCustomSagaStoreTableSchema (): void
3333 {
3434 $ schema = SagaTableSchemaFactory::createDefaultSagaStore (
3535 'custom_saga_store ' ,
36- 'custom_saga_id ' ,
36+ 'custom_id ' ,
3737 'custom_saga_name ' ,
3838 'custom_payload ' ,
3939 'custom_created_at ' ,
@@ -43,12 +43,36 @@ public function itShouldCreateCustomEventStoreTableSchema(): void
4343 );
4444
4545 self ::assertSame ('custom_saga_store ' , $ schema ->tableName );
46- self ::assertSame ('custom_saga_id ' , $ schema ->sagaIdFieldName );
46+ self ::assertSame ('custom_id ' , $ schema ->idFieldName );
4747 self ::assertSame ('custom_saga_name ' , $ schema ->sagaNameFieldName );
4848 self ::assertSame ('custom_payload ' , $ schema ->payloadFieldName );
4949 self ::assertSame ('custom_created_at ' , $ schema ->createdAtFieldName );
5050 self ::assertSame ('custom_created_at_format ' , $ schema ->createdAtFieldFormat );
5151 self ::assertSame ('custom_updated_at ' , $ schema ->updatedAtFieldName );
5252 self ::assertSame ('custom_updated_at_format ' , $ schema ->updatedAtFieldFormat );
5353 }
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+ }
5478}
0 commit comments