@@ -28,7 +28,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
28
28
public static function setUpBeforeClass ()
29
29
{
30
30
$ phpBin = new PhpExecutableFinder ();
31
- self ::$ phpBin = $ phpBin ->find ();
31
+ self ::$ phpBin = ' phpdbg ' === PHP_SAPI ? ' php ' : $ phpBin ->find ();
32
32
}
33
33
34
34
public function testThatProcessDoesNotThrowWarningDuringRun ()
@@ -81,7 +81,7 @@ public function testStopWithTimeoutIsActuallyWorking()
81
81
// exec is mandatory here since we send a signal to the process
82
82
// see https://github.com/symfony/symfony/issues/5030 about prepending
83
83
// command with exec
84
- $ p = $ this ->getProcess ('exec php ' .__DIR__ .'/NonStopableProcess.php 3 ' );
84
+ $ p = $ this ->getProcess ('exec ' . self :: $ phpBin . ' ' .__DIR__ .'/NonStopableProcess.php 3 ' );
85
85
$ p ->start ();
86
86
usleep (100000 );
87
87
$ start = microtime (true );
@@ -470,7 +470,7 @@ public function testTTYCommand()
470
470
$ this ->markTestSkipped ('Windows does have /dev/tty support ' );
471
471
}
472
472
473
- $ process = $ this ->getProcess ('echo "foo" >> /dev/null && php -r "usleep(100000);" ' );
473
+ $ process = $ this ->getProcess ('echo "foo" >> /dev/null && ' . self :: $ phpBin . ' -r "usleep(100000);" ' );
474
474
$ process ->setTty (true );
475
475
$ process ->start ();
476
476
$ this ->assertTrue ($ process ->isRunning ());
@@ -730,7 +730,7 @@ public function testProcessThrowsExceptionWhenExternallySignaled()
730
730
731
731
$ termSignal = defined ('SIGKILL ' ) ? SIGKILL : 9 ;
732
732
733
- $ process = $ this ->getProcess ('exec php -r "while (true) {}" ' );
733
+ $ process = $ this ->getProcess ('exec ' . self :: $ phpBin . ' -r "while (true) {}" ' );
734
734
$ process ->start ();
735
735
posix_kill ($ process ->getPid (), $ termSignal );
736
736
@@ -756,18 +756,6 @@ public function testRestart()
756
756
$ this ->assertNotEquals ($ process1 ->getOutput (), $ process2 ->getOutput ());
757
757
}
758
758
759
- public function testPhpDeadlock ()
760
- {
761
- $ this ->markTestSkipped ('Can cause PHP to hang ' );
762
-
763
- // Sleep doesn't work as it will allow the process to handle signals and close
764
- // file handles from the other end.
765
- $ process = $ this ->getProcess (self ::$ phpBin .' -r "while (true) {}" ' );
766
- $ process ->start ();
767
-
768
- // PHP will deadlock when it tries to cleanup $process
769
- }
770
-
771
759
public function testRunProcessWithTimeout ()
772
760
{
773
761
$ timeout = 0.5 ;
0 commit comments