8484use Symfony \Component \Validator \Validator \ValidatorInterface ;
8585use Symfony \Component \Webhook \Client \RequestParser ;
8686use Symfony \Component \Webhook \Controller \WebhookController ;
87- use Symfony \Component \Workflow ;
8887use Symfony \Component \Workflow \Exception \InvalidDefinitionException ;
8988use Symfony \Component \Workflow \Metadata \InMemoryMetadataStore ;
9089use Symfony \Component \Workflow \WorkflowEvents ;
@@ -302,7 +301,15 @@ public function testWorkflows()
302301 $ this ->assertArrayHasKey ('index_4 ' , $ args );
303302 $ this ->assertNull ($ args ['index_4 ' ], 'Workflows has eventsToDispatch=null ' );
304303
305- $ this ->assertSame (['workflow ' => [['name ' => 'article ' ]], 'workflow.workflow ' => [['name ' => 'article ' ]]], $ container ->getDefinition ('workflow.article ' )->getTags ());
304+ $ tags = $ container ->getDefinition ('workflow.article ' )->getTags ();
305+ $ this ->assertArrayHasKey ('workflow ' , $ tags );
306+ $ this ->assertArrayHasKey ('workflow.workflow ' , $ tags );
307+ $ this ->assertSame ([['name ' => 'article ' ]], $ tags ['workflow.workflow ' ]);
308+ $ this ->assertSame ('article ' , $ tags ['workflow ' ][0 ]['name ' ] ?? null );
309+ $ this ->assertSame ([
310+ 'title ' => 'article workflow ' ,
311+ 'description ' => 'workflow for articles ' ,
312+ ], $ tags ['workflow ' ][0 ]['metadata ' ] ?? null );
306313
307314 $ this ->assertTrue ($ container ->hasDefinition ('workflow.article.definition ' ), 'Workflow definition is registered as a service ' );
308315
@@ -333,7 +340,14 @@ public function testWorkflows()
333340 $ this ->assertSame ('state_machine.abstract ' , $ container ->getDefinition ('state_machine.pull_request ' )->getParent ());
334341 $ this ->assertTrue ($ container ->hasDefinition ('state_machine.pull_request.definition ' ), 'State machine definition is registered as a service ' );
335342
336- $ this ->assertSame (['workflow ' => [['name ' => 'pull_request ' ]], 'workflow.state_machine ' => [['name ' => 'pull_request ' ]]], $ container ->getDefinition ('state_machine.pull_request ' )->getTags ());
343+ $ tags = $ container ->getDefinition ('state_machine.pull_request ' )->getTags ();
344+ $ this ->assertArrayHasKey ('workflow ' , $ tags );
345+ $ this ->assertArrayHasKey ('workflow.state_machine ' , $ tags );
346+ $ this ->assertSame ([['name ' => 'pull_request ' ]], $ tags ['workflow.state_machine ' ]);
347+ $ this ->assertSame ('pull_request ' , $ tags ['workflow ' ][0 ]['name ' ] ?? null );
348+ $ this ->assertSame ([
349+ 'title ' => 'workflow title ' ,
350+ ], $ tags ['workflow ' ][0 ]['metadata ' ] ?? null );
337351
338352 $ stateMachineDefinition = $ container ->getDefinition ('state_machine.pull_request.definition ' );
339353
@@ -357,7 +371,7 @@ public function testWorkflows()
357371 $ this ->assertSame ('state_machine.pull_request.metadata_store ' , (string ) $ metadataStoreReference );
358372
359373 $ metadataStoreDefinition = $ container ->getDefinition ('state_machine.pull_request.metadata_store ' );
360- $ this ->assertSame (Workflow \ Metadata \ InMemoryMetadataStore::class, $ metadataStoreDefinition ->getClass ());
374+ $ this ->assertSame (InMemoryMetadataStore::class, $ metadataStoreDefinition ->getClass ());
361375 $ this ->assertSame (InMemoryMetadataStore::class, $ metadataStoreDefinition ->getClass ());
362376
363377 $ workflowMetadata = $ metadataStoreDefinition ->getArgument (0 );
0 commit comments