@@ -27,7 +27,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
27
27
public static function setUpBeforeClass ()
28
28
{
29
29
$ phpBin = new PhpExecutableFinder ();
30
- self ::$ phpBin = $ phpBin ->find ();
30
+ self ::$ phpBin = ' phpdbg ' === PHP_SAPI ? ' php ' : $ phpBin ->find ();
31
31
}
32
32
33
33
public function testThatProcessDoesNotThrowWarningDuringRun ()
@@ -80,7 +80,7 @@ public function testStopWithTimeoutIsActuallyWorking()
80
80
// exec is mandatory here since we send a signal to the process
81
81
// see https://github.com/symfony/symfony/issues/5030 about prepending
82
82
// command with exec
83
- $ p = $ this ->getProcess ('exec php ' .__DIR__ .'/NonStopableProcess.php 3 ' );
83
+ $ p = $ this ->getProcess ('exec ' . self :: $ phpBin . ' ' .__DIR__ .'/NonStopableProcess.php 3 ' );
84
84
$ p ->start ();
85
85
usleep (100000 );
86
86
$ start = microtime (true );
@@ -410,7 +410,7 @@ public function testTTYCommand()
410
410
$ this ->markTestSkipped ('Windows does have /dev/tty support ' );
411
411
}
412
412
413
- $ process = $ this ->getProcess ('echo "foo" >> /dev/null && php -r "usleep(100000);" ' );
413
+ $ process = $ this ->getProcess ('echo "foo" >> /dev/null && ' . self :: $ phpBin . ' -r "usleep(100000);" ' );
414
414
$ process ->setTty (true );
415
415
$ process ->start ();
416
416
$ this ->assertTrue ($ process ->isRunning ());
@@ -633,7 +633,7 @@ public function testProcessThrowsExceptionWhenExternallySignaled()
633
633
634
634
$ termSignal = defined ('SIGKILL ' ) ? SIGKILL : 9 ;
635
635
636
- $ process = $ this ->getProcess ('exec php -r "while (true) {}" ' );
636
+ $ process = $ this ->getProcess ('exec ' . self :: $ phpBin . ' -r "while (true) {}" ' );
637
637
$ process ->start ();
638
638
posix_kill ($ process ->getPid (), $ termSignal );
639
639
@@ -659,18 +659,6 @@ public function testRestart()
659
659
$ this ->assertNotEquals ($ process1 ->getOutput (), $ process2 ->getOutput ());
660
660
}
661
661
662
- public function testPhpDeadlock ()
663
- {
664
- $ this ->markTestSkipped ('Can cause PHP to hang ' );
665
-
666
- // Sleep doesn't work as it will allow the process to handle signals and close
667
- // file handles from the other end.
668
- $ process = $ this ->getProcess (self ::$ phpBin .' -r "while (true) {}" ' );
669
- $ process ->start ();
670
-
671
- // PHP will deadlock when it tries to cleanup $process
672
- }
673
-
674
662
public function testRunProcessWithTimeout ()
675
663
{
676
664
$ timeout = 0.5 ;
0 commit comments