@@ -24,25 +24,6 @@ class WorkflowExtensionTest extends TestCase
24
24
private $ extension ;
25
25
26
26
protected function setUp ()
27
- {
28
- $ places = array ('ordered ' , 'waiting_for_payment ' , 'processed ' );
29
- $ transitions = array (
30
- new Transition ('t1 ' , 'ordered ' , 'waiting_for_payment ' ),
31
- new Transition ('t2 ' , 'waiting_for_payment ' , 'processed ' ),
32
- );
33
- $ definition = new Definition ($ places , $ transitions );
34
- $ workflow = new Workflow ($ definition );
35
-
36
- $ registry = new Registry ();
37
- $ registry ->addWorkflow ($ workflow , new InstanceOfSupportStrategy (\stdClass::class));
38
-
39
- $ this ->extension = new WorkflowExtension ($ registry );
40
- }
41
-
42
- /**
43
- * @group legacy
44
- */
45
- protected function setUpLegacyAdd ()
46
27
{
47
28
if (!class_exists (Workflow::class)) {
48
29
$ this ->markTestSkipped ('The Workflow component is needed to run tests for this extension. ' );
@@ -57,25 +38,10 @@ protected function setUpLegacyAdd()
57
38
$ workflow = new Workflow ($ definition );
58
39
59
40
$ registry = new Registry ();
60
- $ registry ->add ($ workflow , new InstanceOfSupportStrategy (\stdClass::class));
61
-
41
+ $ registry ->{method_exists ($ registry , $ _ = 'addWorkflow ' ) ? $ _ : 'add ' }($ workflow , new InstanceOfSupportStrategy (\stdClass::class));
62
42
$ this ->extension = new WorkflowExtension ($ registry );
63
43
}
64
44
65
- /**
66
- * @group legacy
67
- * @expectedDeprecation Symfony\Component\Workflow\Registry::add is deprecated since Symfony 4.1. Use addWorkflow() instead.
68
- */
69
- public function testCanTransitionLegacy ()
70
- {
71
- $ this ->setUpLegacyAdd ();
72
- $ subject = new \stdClass ();
73
- $ subject ->marking = array ();
74
-
75
- $ this ->assertTrue ($ this ->extension ->canTransition ($ subject , 't1 ' ));
76
- $ this ->assertFalse ($ this ->extension ->canTransition ($ subject , 't2 ' ));
77
- }
78
-
79
45
public function testCanTransition ()
80
46
{
81
47
$ subject = new \stdClass ();
0 commit comments