84
84
use Symfony \Component \Validator \Validator \ValidatorInterface ;
85
85
use Symfony \Component \Webhook \Client \RequestParser ;
86
86
use Symfony \Component \Webhook \Controller \WebhookController ;
87
- use Symfony \Component \Workflow ;
88
87
use Symfony \Component \Workflow \Exception \InvalidDefinitionException ;
89
88
use Symfony \Component \Workflow \Metadata \InMemoryMetadataStore ;
90
89
use Symfony \Component \Workflow \WorkflowEvents ;
@@ -302,7 +301,15 @@ public function testWorkflows()
302
301
$ this ->assertArrayHasKey ('index_4 ' , $ args );
303
302
$ this ->assertNull ($ args ['index_4 ' ], 'Workflows has eventsToDispatch=null ' );
304
303
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 );
306
313
307
314
$ this ->assertTrue ($ container ->hasDefinition ('workflow.article.definition ' ), 'Workflow definition is registered as a service ' );
308
315
@@ -333,7 +340,14 @@ public function testWorkflows()
333
340
$ this ->assertSame ('state_machine.abstract ' , $ container ->getDefinition ('state_machine.pull_request ' )->getParent ());
334
341
$ this ->assertTrue ($ container ->hasDefinition ('state_machine.pull_request.definition ' ), 'State machine definition is registered as a service ' );
335
342
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 );
337
351
338
352
$ stateMachineDefinition = $ container ->getDefinition ('state_machine.pull_request.definition ' );
339
353
@@ -357,7 +371,7 @@ public function testWorkflows()
357
371
$ this ->assertSame ('state_machine.pull_request.metadata_store ' , (string ) $ metadataStoreReference );
358
372
359
373
$ 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 ());
361
375
$ this ->assertSame (InMemoryMetadataStore::class, $ metadataStoreDefinition ->getClass ());
362
376
363
377
$ workflowMetadata = $ metadataStoreDefinition ->getArgument (0 );
0 commit comments