1111use Symfony \Component \Routing \Route ;
1212use Symfony \Component \Workflow \Registry ;
1313use Symfony \Component \Workflow \StateMachine ;
14- use Symfony \Component \Workflow \SupportStrategy \InstanceOfSupportStrategy ;
1514use Yokai \SonataWorkflow \Admin \Extension \WorkflowExtension ;
1615use Yokai \SonataWorkflow \Controller \WorkflowController ;
1716use Yokai \SonataWorkflow \Tests \PullRequest ;
@@ -106,13 +105,14 @@ public function testConfigureSideMenu($marking, array $transitions)
106105
107106 /** @var AdminInterface|ObjectProphecy $admin */
108107 $ admin = $ this ->prophesize (AdminInterface::class);
108+ $ admin ->getTranslationDomain ()->willReturn ('admin ' );
109109 $ admin ->getLabelTranslatorStrategy ()->willReturn ($ labelStrategy ->reveal ());
110110 $ admin ->getSubject ()->willReturn ($ pullRequest );
111111
112112 foreach ($ transitions as $ transition ) {
113- $ labelStrategy ->getLabel ($ transition , 'workflow ' )
113+ $ labelStrategy ->getLabel ($ transition , 'workflow ' , ' transition ' )
114114 ->shouldBeCalledTimes (1 )
115- ->willReturn ('transition. ' .$ transition );
115+ ->willReturn ('workflow. transition. ' .$ transition );
116116 $ admin ->generateObjectUrl ('workflow_apply_transition ' , $ pullRequest , ['transition ' => $ transition ])
117117 ->shouldBeCalledTimes (1 )
118118 ->willReturn ('/pull-request/42/workflow/transition/ ' .$ transition .'/apply ' );
@@ -135,11 +135,13 @@ public function testConfigureSideMenu($marking, array $transitions)
135135 self ::assertNull ($ child = $ menu ->getChild ('workflow_transitions ' ));
136136 self ::assertNotNull ($ child = $ menu ->getChild ('workflow_transitions_empty ' ));
137137 self ::assertSame ('# ' , $ child ->getUri ());
138+ self ::assertSame ('admin ' , $ child ->getExtra ('translation_domain ' ));
138139 self ::assertFalse ($ child ->hasChildren ());
139140 self ::assertEmpty ($ child ->getChildren ());
140141 } else {
141142 self ::assertNull ($ child = $ menu ->getChild ('workflow_transitions_empty ' ));
142143 self ::assertNotNull ($ child = $ menu ->getChild ('workflow_transitions ' ));
144+ self ::assertSame ('admin ' , $ child ->getExtra ('translation_domain ' ));
143145 self ::assertTrue ($ child ->getAttribute ('dropdown ' ));
144146 self ::assertSame ('fa fa-code-fork ' , $ child ->getAttribute ('icon ' ));
145147 self ::assertTrue ($ child ->hasChildren ());
@@ -150,8 +152,9 @@ public function testConfigureSideMenu($marking, array $transitions)
150152 $ icon = 'fa fa-times ' ;
151153 }
152154
153- self ::assertNotNull ($ item = $ child ->getChild ('transition. ' .$ transition ));
155+ self ::assertNotNull ($ item = $ child ->getChild ('workflow. transition. ' .$ transition ));
154156 self ::assertSame ('/pull-request/42/workflow/transition/ ' .$ transition .'/apply ' , $ item ->getUri ());
157+ self ::assertSame ('admin ' , $ item ->getExtra ('translation_domain ' ));
155158 self ::assertSame ($ icon , $ item ->getAttribute ('icon ' ));
156159 }
157160 }
0 commit comments