@@ -28,7 +28,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
2828 public static function setUpBeforeClass ()
2929 {
3030 $ phpBin = new PhpExecutableFinder ();
31- self ::$ phpBin = $ phpBin ->find ();
31+ self ::$ phpBin = ' phpdbg ' === PHP_SAPI ? ' php ' : $ phpBin ->find ();
3232 }
3333
3434 public function testThatProcessDoesNotThrowWarningDuringRun ()
@@ -81,7 +81,7 @@ public function testStopWithTimeoutIsActuallyWorking()
8181 // exec is mandatory here since we send a signal to the process
8282 // see https://github.com/symfony/symfony/issues/5030 about prepending
8383 // command with exec
84- $ p = $ this ->getProcess ('exec php ' .__DIR__ .'/NonStopableProcess.php 3 ' );
84+ $ p = $ this ->getProcess ('exec ' . self :: $ phpBin . ' ' .__DIR__ .'/NonStopableProcess.php 3 ' );
8585 $ p ->start ();
8686 usleep (100000 );
8787 $ start = microtime (true );
@@ -452,7 +452,7 @@ public function testTTYCommand()
452452 $ this ->markTestSkipped ('Windows does have /dev/tty support ' );
453453 }
454454
455- $ process = $ this ->getProcess ('echo "foo" >> /dev/null && php -r "usleep(100000);" ' );
455+ $ process = $ this ->getProcess ('echo "foo" >> /dev/null && ' . self :: $ phpBin . ' -r "usleep(100000);" ' );
456456 $ process ->setTty (true );
457457 $ process ->start ();
458458 $ this ->assertTrue ($ process ->isRunning ());
@@ -712,7 +712,7 @@ public function testProcessThrowsExceptionWhenExternallySignaled()
712712
713713 $ termSignal = defined ('SIGKILL ' ) ? SIGKILL : 9 ;
714714
715- $ process = $ this ->getProcess ('exec php -r "while (true) {}" ' );
715+ $ process = $ this ->getProcess ('exec ' . self :: $ phpBin . ' -r "while (true) {}" ' );
716716 $ process ->start ();
717717 posix_kill ($ process ->getPid (), $ termSignal );
718718
@@ -738,18 +738,6 @@ public function testRestart()
738738 $ this ->assertNotEquals ($ process1 ->getOutput (), $ process2 ->getOutput ());
739739 }
740740
741- public function testPhpDeadlock ()
742- {
743- $ this ->markTestSkipped ('Can cause PHP to hang ' );
744-
745- // Sleep doesn't work as it will allow the process to handle signals and close
746- // file handles from the other end.
747- $ process = $ this ->getProcess (self ::$ phpBin .' -r "while (true) {}" ' );
748- $ process ->start ();
749-
750- // PHP will deadlock when it tries to cleanup $process
751- }
752-
753741 public function testRunProcessWithTimeout ()
754742 {
755743 $ timeout = 0.5 ;
0 commit comments