11
11
use Symfony \Component \Routing \Route ;
12
12
use Symfony \Component \Workflow \Registry ;
13
13
use Symfony \Component \Workflow \StateMachine ;
14
- use Symfony \Component \Workflow \SupportStrategy \InstanceOfSupportStrategy ;
15
14
use Yokai \SonataWorkflow \Admin \Extension \WorkflowExtension ;
16
15
use Yokai \SonataWorkflow \Controller \WorkflowController ;
17
16
use Yokai \SonataWorkflow \Tests \PullRequest ;
@@ -106,13 +105,14 @@ public function testConfigureSideMenu($marking, array $transitions)
106
105
107
106
/** @var AdminInterface|ObjectProphecy $admin */
108
107
$ admin = $ this ->prophesize (AdminInterface::class);
108
+ $ admin ->getTranslationDomain ()->willReturn ('admin ' );
109
109
$ admin ->getLabelTranslatorStrategy ()->willReturn ($ labelStrategy ->reveal ());
110
110
$ admin ->getSubject ()->willReturn ($ pullRequest );
111
111
112
112
foreach ($ transitions as $ transition ) {
113
- $ labelStrategy ->getLabel ($ transition , 'workflow ' )
113
+ $ labelStrategy ->getLabel ($ transition , 'workflow ' , ' transition ' )
114
114
->shouldBeCalledTimes (1 )
115
- ->willReturn ('transition. ' .$ transition );
115
+ ->willReturn ('workflow. transition. ' .$ transition );
116
116
$ admin ->generateObjectUrl ('workflow_apply_transition ' , $ pullRequest , ['transition ' => $ transition ])
117
117
->shouldBeCalledTimes (1 )
118
118
->willReturn ('/pull-request/42/workflow/transition/ ' .$ transition .'/apply ' );
@@ -135,11 +135,13 @@ public function testConfigureSideMenu($marking, array $transitions)
135
135
self ::assertNull ($ child = $ menu ->getChild ('workflow_transitions ' ));
136
136
self ::assertNotNull ($ child = $ menu ->getChild ('workflow_transitions_empty ' ));
137
137
self ::assertSame ('# ' , $ child ->getUri ());
138
+ self ::assertSame ('admin ' , $ child ->getExtra ('translation_domain ' ));
138
139
self ::assertFalse ($ child ->hasChildren ());
139
140
self ::assertEmpty ($ child ->getChildren ());
140
141
} else {
141
142
self ::assertNull ($ child = $ menu ->getChild ('workflow_transitions_empty ' ));
142
143
self ::assertNotNull ($ child = $ menu ->getChild ('workflow_transitions ' ));
144
+ self ::assertSame ('admin ' , $ child ->getExtra ('translation_domain ' ));
143
145
self ::assertTrue ($ child ->getAttribute ('dropdown ' ));
144
146
self ::assertSame ('fa fa-code-fork ' , $ child ->getAttribute ('icon ' ));
145
147
self ::assertTrue ($ child ->hasChildren ());
@@ -150,8 +152,9 @@ public function testConfigureSideMenu($marking, array $transitions)
150
152
$ icon = 'fa fa-times ' ;
151
153
}
152
154
153
- self ::assertNotNull ($ item = $ child ->getChild ('transition. ' .$ transition ));
155
+ self ::assertNotNull ($ item = $ child ->getChild ('workflow. transition. ' .$ transition ));
154
156
self ::assertSame ('/pull-request/42/workflow/transition/ ' .$ transition .'/apply ' , $ item ->getUri ());
157
+ self ::assertSame ('admin ' , $ item ->getExtra ('translation_domain ' ));
155
158
self ::assertSame ($ icon , $ item ->getAttribute ('icon ' ));
156
159
}
157
160
}
0 commit comments