File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
codeception/unit/workflow/events Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ To run a single test :
38
38
39
39
## Memento
40
40
41
+ ### Output to Console during Tests
42
+
41
43
To output to console from a codeception test use :
42
44
```
43
45
\Codeception\Util\Debug::debug($someVariable);
@@ -47,3 +49,10 @@ With debug mode enabled :
47
49
```
48
50
../vendor/bin/codecept run --debug codeception/unit/workflow/helpers/WorkflowHelperTest.php
49
51
```
52
+
53
+ ### Enable XDebug With Codeception
54
+
55
+ Check XDebug is installed :
56
+ - run ` php -i > info.txt `
57
+ - copy/paste ` info.txt ` into [ this form] ( https://xdebug.org/wizard.php ) and check the result
58
+ - if needed, follow * Installation instructions* .
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ protected function setup()
32
32
'namespace ' => 'tests\codeception\unit\models '
33
33
]
34
34
]);
35
-
35
+
36
36
Yii::$ app ->set ('eventSequence ' ,[
37
37
'class ' => 'raoul2000\workflow\events\ExtendedEventSequence ' ,
38
38
]);
@@ -54,6 +54,7 @@ public function testChangeStatusEventOnSaveSuccess()
54
54
$ this ->model ->on (
55
55
WorkflowEvent::beforeEnterStatus (),
56
56
function ($ event ) {
57
+ codecept_debug ("beforeEnterStatus " );
57
58
$ this ->eventsBefore [] = $ event ;
58
59
}
59
60
);
@@ -63,10 +64,12 @@ function($event) {
63
64
$ this ->eventsAfter [] = $ event ;
64
65
}
65
66
);
67
+ codecept_debug (count ($ this ->eventsBefore ));
66
68
verify ('event handler handlers have been called ' , count ($ this ->eventsBefore ) == 0 && count ($ this ->eventsAfter ) == 0 )->true ();
67
69
68
70
$ this ->model ->enterWorkflow ();
69
71
verify ('current status is set ' ,$ this ->model ->hasWorkflowStatus ())->true ();
72
+ codecept_debug (count ($ this ->eventsBefore ));
70
73
expect ('event handler handlers have been called ' , count ($ this ->eventsBefore ) == 1 && count ($ this ->eventsAfter ) == 1 )->true ();
71
74
72
75
$ this ->model ->status = 'Item04Workflow/B ' ;
You can’t perform that action at this time.
0 commit comments