@@ -64,6 +64,10 @@ public function test_it_can_run_the_command_without_sub_processes(): void
64
64
Processing 5 items in segments of 2, batches of 2, 1 round, 1 batch in 1 process
65
65
66
66
0/5 [>---------------------------] 0% 10 secs/10 secs 10.0 MiB
67
+ 1/5 [=====>----------------------] 20% 10 secs/10 secs 10.0 MiB
68
+ 2/5 [===========>----------------] 40% 10 secs/10 secs 10.0 MiB
69
+ 3/5 [================>-----------] 60% 10 secs/10 secs 10.0 MiB
70
+ 4/5 [======================>-----] 80% 10 secs/10 secs 10.0 MiB
67
71
5/5 [============================] 100% 10 secs/10 secs 10.0 MiB
68
72
69
73
Processed 5 items.
@@ -136,6 +140,18 @@ public function test_it_can_run_the_command_with_multiple_processes_in_debug_mod
136
140
],
137
141
);
138
142
143
+ $ expectedWithNoDebugMode = <<<'EOF'
144
+ Processing 5 movies in segments of 2, batches of 2, 3 rounds, 3 batches in 2 processes
145
+
146
+ 0/5 [>---------------------------] 0% 10 secs/10 secs 10.0 MiB
147
+ 2/5 [===========>----------------] 40% 10 secs/10 secs 10.0 MiB
148
+ 4/5 [======================>-----] 80% 10 secs/10 secs 10.0 MiB
149
+ 5/5 [============================] 100% 10 secs/10 secs 10.0 MiB
150
+
151
+ Processed 5 movies.
152
+
153
+ EOF;
154
+
139
155
$ expected = <<<'EOF'
140
156
Processing 5 movies in segments of 2, batches of 2, 3 rounds, 3 batches in 2 processes
141
157
@@ -156,7 +172,19 @@ public function test_it_can_run_the_command_with_multiple_processes_in_debug_mod
156
172
157
173
$ actual = $ this ->getOutput ($ commandTester );
158
174
159
- self ::assertSame ($ expected , $ actual , $ actual );
175
+ $ expectedChildProcessesCount = 3 ;
176
+ $ expectedCommandStartedLine = "[debug] Command started: '/path/to/php' '/path/to/work-dir/bin/console' 'import:movies' '--child' \n" ;
177
+ $ expectedCommandFinishedLine = "[debug] Command finished \n" ;
178
+
179
+ $ outputWithoutExtraDebugInfo = str_replace (
180
+ [$ expectedCommandStartedLine , $ expectedCommandFinishedLine ],
181
+ ['' , '' ],
182
+ $ actual ,
183
+ );
184
+
185
+ self ::assertSame ($ expectedWithNoDebugMode , $ outputWithoutExtraDebugInfo , $ outputWithoutExtraDebugInfo );
186
+ self ::assertSame ($ expectedChildProcessesCount , mb_substr_count ($ actual , $ expectedCommandStartedLine ));
187
+ self ::assertSame ($ expectedChildProcessesCount , mb_substr_count ($ actual , $ expectedCommandFinishedLine ));
160
188
}
161
189
162
190
private function getOutput (CommandTester $ commandTester ): string
0 commit comments