8
8
use Symfony \Component \Workflow \Event \GuardEvent ;
9
9
use Symfony \Component \Workflow \Marking ;
10
10
use Symfony \Component \Workflow \MarkingStore \MarkingStoreInterface ;
11
- use Symfony \Component \Workflow \MarkingStore \PropertyAccessorMarkingStore ;
11
+ use Symfony \Component \Workflow \MarkingStore \MultipleStateMarkingStore ;
12
12
use Symfony \Component \Workflow \Transition ;
13
13
use Symfony \Component \Workflow \Workflow ;
14
14
@@ -35,7 +35,7 @@ public function testGetMarkingWithEmptyDefinition()
35
35
{
36
36
$ subject = new \stdClass ();
37
37
$ subject ->marking = null ;
38
- $ workflow = new Workflow (new Definition (array (), array ()), new PropertyAccessorMarkingStore ());
38
+ $ workflow = new Workflow (new Definition (array (), array ()), new MultipleStateMarkingStore ());
39
39
40
40
$ workflow ->getMarking ($ subject );
41
41
}
@@ -49,7 +49,7 @@ public function testGetMarkingWithImpossiblePlace()
49
49
$ subject = new \stdClass ();
50
50
$ subject ->marking = null ;
51
51
$ subject ->marking = array ('nope ' => true );
52
- $ workflow = new Workflow (new Definition (array (), array ()), new PropertyAccessorMarkingStore ());
52
+ $ workflow = new Workflow (new Definition (array (), array ()), new MultipleStateMarkingStore ());
53
53
54
54
$ workflow ->getMarking ($ subject );
55
55
}
@@ -59,7 +59,7 @@ public function testGetMarkingWithEmptyInitialMarking()
59
59
$ definition = $ this ->createComplexWorkflow ();
60
60
$ subject = new \stdClass ();
61
61
$ subject ->marking = null ;
62
- $ workflow = new Workflow ($ definition , new PropertyAccessorMarkingStore ());
62
+ $ workflow = new Workflow ($ definition , new MultipleStateMarkingStore ());
63
63
64
64
$ marking = $ workflow ->getMarking ($ subject );
65
65
@@ -74,7 +74,7 @@ public function testGetMarkingWithExistingMarking()
74
74
$ subject = new \stdClass ();
75
75
$ subject ->marking = null ;
76
76
$ subject ->marking = array ('b ' => 1 , 'c ' => 1 );
77
- $ workflow = new Workflow ($ definition , new PropertyAccessorMarkingStore ());
77
+ $ workflow = new Workflow ($ definition , new MultipleStateMarkingStore ());
78
78
79
79
$ marking = $ workflow ->getMarking ($ subject );
80
80
@@ -92,7 +92,7 @@ public function testCanWithUnexistingTransition()
92
92
$ definition = $ this ->createComplexWorkflow ();
93
93
$ subject = new \stdClass ();
94
94
$ subject ->marking = null ;
95
- $ workflow = new Workflow ($ definition , new PropertyAccessorMarkingStore ());
95
+ $ workflow = new Workflow ($ definition , new MultipleStateMarkingStore ());
96
96
97
97
$ workflow ->can ($ subject , 'foobar ' );
98
98
}
@@ -102,7 +102,7 @@ public function testCan()
102
102
$ definition = $ this ->createComplexWorkflow ();
103
103
$ subject = new \stdClass ();
104
104
$ subject ->marking = null ;
105
- $ workflow = new Workflow ($ definition , new PropertyAccessorMarkingStore ());
105
+ $ workflow = new Workflow ($ definition , new MultipleStateMarkingStore ());
106
106
107
107
$ this ->assertTrue ($ workflow ->can ($ subject , 't1 ' ));
108
108
$ this ->assertFalse ($ workflow ->can ($ subject , 't2 ' ));
@@ -117,7 +117,7 @@ public function testCanWithGuard()
117
117
$ eventDispatcher ->addListener ('workflow.workflow_name.guard.t1 ' , function (GuardEvent $ event ) {
118
118
$ event ->setBlocked (true );
119
119
});
120
- $ workflow = new Workflow ($ definition , new PropertyAccessorMarkingStore (), $ eventDispatcher , 'workflow_name ' );
120
+ $ workflow = new Workflow ($ definition , new MultipleStateMarkingStore (), $ eventDispatcher , 'workflow_name ' );
121
121
122
122
$ this ->assertFalse ($ workflow ->can ($ subject , 't1 ' ));
123
123
}
@@ -131,7 +131,7 @@ public function testApplyWithImpossibleTransition()
131
131
$ definition = $ this ->createComplexWorkflow ();
132
132
$ subject = new \stdClass ();
133
133
$ subject ->marking = null ;
134
- $ workflow = new Workflow ($ definition , new PropertyAccessorMarkingStore ());
134
+ $ workflow = new Workflow ($ definition , new MultipleStateMarkingStore ());
135
135
136
136
$ workflow ->apply ($ subject , 't2 ' );
137
137
}
@@ -141,7 +141,7 @@ public function testApply()
141
141
$ definition = $ this ->createComplexWorkflow ();
142
142
$ subject = new \stdClass ();
143
143
$ subject ->marking = null ;
144
- $ workflow = new Workflow ($ definition , new PropertyAccessorMarkingStore ());
144
+ $ workflow = new Workflow ($ definition , new MultipleStateMarkingStore ());
145
145
146
146
$ marking = $ workflow ->apply ($ subject , 't1 ' );
147
147
@@ -157,7 +157,7 @@ public function testApplyWithEventDispatcher()
157
157
$ subject = new \stdClass ();
158
158
$ subject ->marking = null ;
159
159
$ eventDispatcher = new EventDispatcherMock ();
160
- $ workflow = new Workflow ($ definition , new PropertyAccessorMarkingStore (), $ eventDispatcher , 'workflow_name ' );
160
+ $ workflow = new Workflow ($ definition , new MultipleStateMarkingStore (), $ eventDispatcher , 'workflow_name ' );
161
161
162
162
$ eventNameExpected = array (
163
163
'workflow.guard ' ,
@@ -194,7 +194,7 @@ public function testGetEnabledTransitions()
194
194
$ eventDispatcher ->addListener ('workflow.workflow_name.guard.t1 ' , function (GuardEvent $ event ) {
195
195
$ event ->setBlocked (true );
196
196
});
197
- $ workflow = new Workflow ($ definition , new PropertyAccessorMarkingStore (), $ eventDispatcher , 'workflow_name ' );
197
+ $ workflow = new Workflow ($ definition , new MultipleStateMarkingStore (), $ eventDispatcher , 'workflow_name ' );
198
198
199
199
$ this ->assertEmpty ($ workflow ->getEnabledTransitions ($ subject ));
200
200
0 commit comments