SigchildEnabledProcessTest.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. /**
  42. * @expectedException Symfony\Component\Process\Exception\RuntimeException
  43. */
  44. public function testGetPid()
  45. {
  46. parent::testGetPid();
  47. }
  48. /**
  49. * @expectedException Symfony\Component\Process\Exception\RuntimeException
  50. */
  51. public function testGetPidIsNullBeforeStart()
  52. {
  53. parent::testGetPidIsNullBeforeStart();
  54. }
  55. /**
  56. * @expectedException Symfony\Component\Process\Exception\RuntimeException
  57. */
  58. public function testGetPidIsNullAfterRun()
  59. {
  60. parent::testGetPidIsNullAfterRun();
  61. }
  62. public function testExitCodeText()
  63. {
  64. $process = $this->getProcess('qdfsmfkqsdfmqmsd');
  65. $process->run();
  66. $this->assertInternalType('string', $process->getExitCodeText());
  67. }
  68. /**
  69. * @expectedException Symfony\Component\Process\Exception\RuntimeException
  70. */
  71. public function testSignal()
  72. {
  73. parent::testSignal();
  74. }
  75. /**
  76. * @expectedException Symfony\Component\Process\Exception\RuntimeException
  77. */
  78. public function testProcessWithoutTermSignalIsNotSignaled()
  79. {
  80. parent::testProcessWithoutTermSignalIsNotSignaled();
  81. }
  82. public function testProcessThrowsExceptionWhenExternallySignaled()
  83. {
  84. $this->markTestSkipped('Retrieving Pid is not supported in sigchild environment');
  85. }
  86. public function testExitCodeIsAvailableAfterSignal()
  87. {
  88. $this->markTestSkipped('Signal is not supported in sigchild environment');
  89. }
  90. /**
  91. * {@inheritdoc}
  92. */
  93. protected function getProcess($commandline, $cwd = null, array $env = null, $stdin = null, $timeout = 60, array $options = array())
  94. {
  95. $process = new ProcessInSigchildEnvironment($commandline, $cwd, $env, $stdin, $timeout, $options);
  96. $process->setEnhanceSigchildCompatibility(true);
  97. return $process;
  98. }
  99. }