File tree 4 files changed +16
-9
lines changed
4 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 4
4
use Safemood \Workflow \Traits \ActionsTrait ;
5
5
6
6
beforeEach (function () {
7
- $ this ->dummyClass = new class {
7
+ $ this ->dummyClass = new class
8
+ {
8
9
use ActionsTrait;
9
10
};
10
11
});
33
34
it ('can add multiple before actions ' , function () {
34
35
$ beforeActions = [
35
36
Mockery::mock (Action::class),
36
- Mockery::mock (Action::class)
37
+ Mockery::mock (Action::class),
37
38
];
38
39
39
40
$ this ->dummyClass ->addBeforeActions ($ beforeActions );
44
45
it ('can add multiple main actions ' , function () {
45
46
$ mainActions = [
46
47
Mockery::mock (Action::class),
47
- Mockery::mock (Action::class)
48
+ Mockery::mock (Action::class),
48
49
];
49
50
$ this ->dummyClass ->addMainActions ($ mainActions );
50
51
54
55
it ('can add multiple after actions ' , function () {
55
56
$ afterActions = [
56
57
Mockery::mock (Action::class),
57
- Mockery::mock (Action::class)
58
+ Mockery::mock (Action::class),
58
59
];
59
60
$ this ->dummyClass ->addAfterActions ($ afterActions );
60
61
Original file line number Diff line number Diff line change 3
3
use Safemood \Workflow \Traits \HasResponses ;
4
4
5
5
beforeEach (function () {
6
- $ this ->dummyClass = new class {
6
+ $ this ->dummyClass = new class
7
+ {
7
8
use HasResponses;
8
9
};
9
10
});
Original file line number Diff line number Diff line change 5
5
use Safemood \Workflow \Traits \TracksActionStates ;
6
6
7
7
beforeEach (function () {
8
- $ this ->dummyClass = new class {
8
+ $ this ->dummyClass = new class
9
+ {
9
10
use TracksActionStates;
10
11
11
12
public $ beforeActions = [];
13
+
12
14
public $ mainActions = [];
15
+
13
16
public $ afterActions = [];
14
17
15
18
// Methods to expose the protected trait methods for testing
@@ -34,8 +37,10 @@ public function isFailing(): bool
34
37
}
35
38
};
36
39
37
- $ this ->dummyAction = new class extends Action {
40
+ $ this ->dummyAction = new class extends Action
41
+ {
38
42
protected $ state ;
43
+
39
44
protected $ exception ;
40
45
41
46
public function handle (array &$ context )
@@ -45,7 +50,6 @@ public function handle(array &$context)
45
50
}
46
51
$ context ['validated ' ] = true ;
47
52
}
48
-
49
53
};
50
54
});
51
55
Original file line number Diff line number Diff line change 4
4
use Safemood \Workflow \Traits \TracksEvents ;
5
5
6
6
beforeEach (function () {
7
- $ this ->dummyClass = new class {
7
+ $ this ->dummyClass = new class
8
+ {
8
9
use TracksEvents;
9
10
10
11
public function startTrackingAllEvents ()
You can’t perform that action at this time.
0 commit comments