SigchildDisabledProcessTest.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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 SigchildDisabledProcessTest extends AbstractProcessTest
  12. {
  13. /**
  14. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  15. */
  16. public function testGetExitCode()
  17. {
  18. parent::testGetExitCode();
  19. }
  20. /**
  21. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  22. */
  23. public function testGetExitCodeIsNullOnStart()
  24. {
  25. parent::testGetExitCodeIsNullOnStart();
  26. }
  27. /**
  28. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  29. */
  30. public function testGetExitCodeIsNullOnWhenStartingAgain()
  31. {
  32. parent::testGetExitCodeIsNullOnWhenStartingAgain();
  33. }
  34. /**
  35. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  36. */
  37. public function testExitCodeCommandFailed()
  38. {
  39. parent::testExitCodeCommandFailed();
  40. }
  41. /**
  42. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  43. */
  44. public function testProcessIsSignaledIfStopped()
  45. {
  46. parent::testProcessIsSignaledIfStopped();
  47. }
  48. /**
  49. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  50. */
  51. public function testProcessWithTermSignal()
  52. {
  53. parent::testProcessWithTermSignal();
  54. }
  55. /**
  56. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  57. */
  58. public function testProcessIsNotSignaled()
  59. {
  60. parent::testProcessIsNotSignaled();
  61. }
  62. /**
  63. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  64. */
  65. public function testProcessWithoutTermSignal()
  66. {
  67. parent::testProcessWithoutTermSignal();
  68. }
  69. /**
  70. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  71. */
  72. public function testCheckTimeoutOnStartedProcess()
  73. {
  74. parent::testCheckTimeoutOnStartedProcess();
  75. }
  76. /**
  77. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  78. */
  79. public function testGetPid()
  80. {
  81. parent::testGetPid();
  82. }
  83. /**
  84. * @expectedException Symfony\Component\Process\Exception\RuntimeException
  85. */
  86. public function testGetPidIsNullBeforeStart()
  87. {
  88. parent::testGetPidIsNullBeforeStart();
  89. }
  90. /**
  91. * @expectedException Symfony\Component\Process\Exception\RuntimeException
  92. */
  93. public function testGetPidIsNullAfterRun()
  94. {
  95. parent::testGetPidIsNullAfterRun();
  96. }
  97. /**
  98. * @expectedException Symfony\Component\Process\Exception\RuntimeException
  99. */
  100. public function testExitCodeText()
  101. {
  102. $process = $this->getProcess('qdfsmfkqsdfmqmsd');
  103. $process->run();
  104. $process->getExitCodeText();
  105. }
  106. /**
  107. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  108. */
  109. public function testIsSuccessful()
  110. {
  111. parent::testIsSuccessful();
  112. }
  113. /**
  114. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  115. */
  116. public function testIsSuccessfulOnlyAfterTerminated()
  117. {
  118. parent::testIsSuccessfulOnlyAfterTerminated();
  119. }
  120. /**
  121. * @expectedException \Symfony\Component\Process\Exception\RuntimeException
  122. */
  123. public function testIsNotSuccessful()
  124. {
  125. parent::testIsNotSuccessful();
  126. }
  127. /**
  128. * @expectedException Symfony\Component\Process\Exception\RuntimeException
  129. */
  130. public function testSignal()
  131. {
  132. parent::testSignal();
  133. }
  134. /**
  135. * @expectedException Symfony\Component\Process\Exception\RuntimeException
  136. */
  137. public function testProcessWithoutTermSignalIsNotSignaled()
  138. {
  139. parent::testProcessWithoutTermSignalIsNotSignaled();
  140. }
  141. public function testStopWithTimeoutIsActuallyWorking()
  142. {
  143. $this->markTestSkipped('Stopping with signal is not supported in sigchild environment');
  144. }
  145. public function testProcessThrowsExceptionWhenExternallySignaled()
  146. {
  147. $this->markTestSkipped('Retrieving Pid is not supported in sigchild environment');
  148. }
  149. public function testExitCodeIsAvailableAfterSignal()
  150. {
  151. $this->markTestSkipped('Signal is not supported in sigchild environment');
  152. }
  153. /**
  154. * {@inheritdoc}
  155. */
  156. protected function getProcess($commandline, $cwd = null, array $env = null, $stdin = null, $timeout = 60, array $options = array())
  157. {
  158. $process = new ProcessInSigchildEnvironment($commandline, $cwd, $env, $stdin, $timeout, $options);
  159. $process->setEnhanceSigchildCompatibility(false);
  160. return $process;
  161. }
  162. }