SigchildEnabledProcessTest.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Process\Tests;
  11. class SigchildEnabledProcessTest extends AbstractProcessTest
  12. {
  13. /**
  14. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  15. */
  16. public function testProcessIsSignaledIfStopped()
  17. {
  18. parent::testProcessIsSignaledIfStopped();
  19. }
  20. /**
  21. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  22. */
  23. public function testProcessWithTermSignal()
  24. {
  25. parent::testProcessWithTermSignal();
  26. }
  27. /**
  28. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  29. */
  30. public function testProcessIsNotSignaled()
  31. {
  32. parent::testProcessIsNotSignaled();
  33. }
  34. /**
  35. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  36. */
  37. public function testProcessWithoutTermSignal()
  38. {
  39. parent::testProcessWithoutTermSignal();
  40. }
  41. public function testExitCodeText()
  42. {
  43. $process = $this->getProcess('qdfsmfkqsdfmqmsd');
  44. $process->run();
  45. $this->assertInternalType('string', $process->getExitCodeText());
  46. }
  47. /**
  48. * {@inheritdoc}
  49. */
  50. protected function getProcess($commandline, $cwd = null, array $env = null, $stdin = null, $timeout = 60, array $options = array())
  51. {
  52. $process = new ProcessInSigchildEnvironment($commandline, $cwd, $env, $stdin, $timeout, $options);
  53. $process->setEnhanceSigchildCompatibility(true);
  54. return $process;
  55. }
  56. }