@@ -152,46 +152,37 @@ public function testSignalWithWrongNonIntSignal()
152
152
153
153
public function testStopTerminatesProcessCleanly ()
154
154
{
155
- try {
156
- $ process = $ this ->getProcess (self ::$ phpBin .' -r "echo \'foo \'; sleep(1); echo \'bar \';" ' );
157
- $ process ->run (function () use ($ process ) {
158
- $ process ->stop ();
159
- });
160
- } catch (\RuntimeException $ e ) {
161
- $ this ->fail ('A call to stop() is not expected to cause wait() to throw a RuntimeException ' );
162
- }
155
+ $ process = $ this ->getProcess (self ::$ phpBin .' -r "echo \'foo \'; sleep(1); echo \'bar \';" ' );
156
+ $ process ->run (function () use ($ process ) {
157
+ $ process ->stop ();
158
+ });
159
+ $ this ->assertTrue (true , 'A call to stop() is not expected to cause wait() to throw a RuntimeException ' );
163
160
}
164
161
165
162
public function testKillSignalTerminatesProcessCleanly ()
166
163
{
167
164
$ this ->expectExceptionIfPHPSigchild ('Symfony\Component\Process\Exception\RuntimeException ' , 'This PHP has been compiled with --enable-sigchild. The process can not be signaled. ' );
168
165
169
- try {
170
- $ process = $ this ->getProcess (self ::$ phpBin .' -r "echo \'foo \'; sleep(1); echo \'bar \';" ' );
171
- $ process ->run (function () use ($ process ) {
172
- if ($ process ->isRunning ()) {
173
- $ process ->signal (defined ('SIGKILL ' ) ? SIGKILL : 9 );
174
- }
175
- });
176
- } catch (\RuntimeException $ e ) {
177
- $ this ->fail ('A call to signal() is not expected to cause wait() to throw a RuntimeException ' );
178
- }
166
+ $ process = $ this ->getProcess (self ::$ phpBin .' -r "echo \'foo \'; sleep(1); echo \'bar \';" ' );
167
+ $ process ->run (function () use ($ process ) {
168
+ if ($ process ->isRunning ()) {
169
+ $ process ->signal (defined ('SIGKILL ' ) ? SIGKILL : 9 );
170
+ }
171
+ });
172
+ $ this ->assertTrue (true , 'A call to signal() is not expected to cause wait() to throw a RuntimeException ' );
179
173
}
180
174
181
175
public function testTermSignalTerminatesProcessCleanly ()
182
176
{
183
177
$ this ->expectExceptionIfPHPSigchild ('Symfony\Component\Process\Exception\RuntimeException ' , 'This PHP has been compiled with --enable-sigchild. The process can not be signaled. ' );
184
178
185
- try {
186
- $ process = $ this ->getProcess (self ::$ phpBin .' -r "echo \'foo \'; sleep(1); echo \'bar \';" ' );
187
- $ process ->run (function () use ($ process ) {
188
- if ($ process ->isRunning ()) {
189
- $ process ->signal (defined ('SIGTERM ' ) ? SIGTERM : 15 );
190
- }
191
- });
192
- } catch (\RuntimeException $ e ) {
193
- $ this ->fail ('A call to signal() is not expected to cause wait() to throw a RuntimeException ' );
194
- }
179
+ $ process = $ this ->getProcess (self ::$ phpBin .' -r "echo \'foo \'; sleep(1); echo \'bar \';" ' );
180
+ $ process ->run (function () use ($ process ) {
181
+ if ($ process ->isRunning ()) {
182
+ $ process ->signal (defined ('SIGTERM ' ) ? SIGTERM : 15 );
183
+ }
184
+ });
185
+ $ this ->assertTrue (true , 'A call to signal() is not expected to cause wait() to throw a RuntimeException ' );
195
186
}
196
187
197
188
public function testStopWithTimeoutIsActuallyWorking ()
0 commit comments