You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #10492 [2.3][Process] Remove unreachable code + avoid skipping tests in sigchild environment (romainneutron)
This PR was merged into the 2.3 branch.
Discussion
----------
[2.3][Process] Remove unreachable code + avoid skipping tests in sigchild environment
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
As mentioned by @Tobion in #10480 (comment), I removed the dead code. I also fixed/updated the test suite on PHP compiled with `--enable-sigchild`.
Commits
-------
d52dd32 [Process] Remove unreachable code + avoid skipping tests in sigchild environment
Copy file name to clipboardExpand all lines: src/Symfony/Component/Process/Tests/SimpleProcessTest.php
+49-25Lines changed: 49 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -27,106 +27,123 @@ public function setUp()
27
27
28
28
publicfunctiontestGetExitCode()
29
29
{
30
-
$this->skipIfPHPSigchild();
30
+
$this->skipIfPHPSigchild();// This test use exitcode that is not available in this case
31
31
parent::testGetExitCode();
32
32
}
33
33
34
34
publicfunctiontestExitCodeCommandFailed()
35
35
{
36
-
$this->skipIfPHPSigchild();
36
+
$this->skipIfPHPSigchild();// This test use exitcode that is not available in this case
37
37
parent::testExitCodeCommandFailed();
38
38
}
39
39
40
40
publicfunctiontestProcessIsSignaledIfStopped()
41
41
{
42
-
$this->skipIfPHPSigchild();
42
+
$this->expectExceptionIfPHPSigchild('Symfony\Component\Process\Exception\RuntimeException', 'This PHP has been compiled with --enable-sigchild. Term signal can not be retrieved');
43
43
parent::testProcessIsSignaledIfStopped();
44
44
}
45
45
46
46
publicfunctiontestProcessWithTermSignal()
47
47
{
48
-
$this->skipIfPHPSigchild();
48
+
$this->expectExceptionIfPHPSigchild('Symfony\Component\Process\Exception\RuntimeException', 'This PHP has been compiled with --enable-sigchild. Term signal can not be retrieved');
49
49
parent::testProcessWithTermSignal();
50
50
}
51
51
52
52
publicfunctiontestProcessIsNotSignaled()
53
53
{
54
-
$this->skipIfPHPSigchild();
54
+
$this->expectExceptionIfPHPSigchild('Symfony\Component\Process\Exception\RuntimeException', 'This PHP has been compiled with --enable-sigchild. Term signal can not be retrieved');
55
55
parent::testProcessIsNotSignaled();
56
56
}
57
57
58
58
publicfunctiontestProcessWithoutTermSignal()
59
59
{
60
-
$this->skipIfPHPSigchild();
60
+
$this->expectExceptionIfPHPSigchild('Symfony\Component\Process\Exception\RuntimeException', 'This PHP has been compiled with --enable-sigchild. Term signal can not be retrieved');
61
61
parent::testProcessWithoutTermSignal();
62
62
}
63
63
64
64
publicfunctiontestExitCodeText()
65
65
{
66
-
$this->skipIfPHPSigchild();
66
+
$this->skipIfPHPSigchild();// This test use exitcode that is not available in this case
67
67
parent::testExitCodeText();
68
68
}
69
69
70
70
publicfunctiontestIsSuccessful()
71
71
{
72
-
$this->skipIfPHPSigchild();
72
+
$this->skipIfPHPSigchild();// This test use PID that is not available in this case
73
73
parent::testIsSuccessful();
74
74
}
75
75
76
76
publicfunctiontestIsNotSuccessful()
77
77
{
78
-
$this->skipIfPHPSigchild();
78
+
$this->skipIfPHPSigchild();// This test use PID that is not available in this case
79
79
parent::testIsNotSuccessful();
80
80
}
81
81
82
82
publicfunctiontestGetPid()
83
83
{
84
-
$this->skipIfPHPSigchild();
84
+
$this->skipIfPHPSigchild();// This test use PID that is not available in this case
85
85
parent::testGetPid();
86
86
}
87
87
88
88
publicfunctiontestGetPidIsNullBeforeStart()
89
89
{
90
-
$this->skipIfPHPSigchild();
90
+
$this->skipIfPHPSigchild();// This test use PID that is not available in this case
91
91
parent::testGetPidIsNullBeforeStart();
92
92
}
93
93
94
94
publicfunctiontestGetPidIsNullAfterRun()
95
95
{
96
-
$this->skipIfPHPSigchild();
96
+
$this->skipIfPHPSigchild();// This test use PID that is not available in this case
97
97
parent::testGetPidIsNullAfterRun();
98
98
}
99
99
100
100
publicfunctiontestSignal()
101
101
{
102
-
$this->skipIfPHPSigchild();
102
+
$this->expectExceptionIfPHPSigchild('Symfony\Component\Process\Exception\RuntimeException', 'This PHP has been compiled with --enable-sigchild. The process can not be signaled.');
$this->expectExceptionIfPHPSigchild('Symfony\Component\Process\Exception\RuntimeException', 'This PHP has been compiled with --enable-sigchild. Term signal can not be retrieved');
$this->expectExceptionIfPHPSigchild('Symfony\Component\Process\Exception\RuntimeException', 'This PHP has been compiled with --enable-sigchild. The process can not be signaled.');
121
+
parent::testExitCodeIsAvailableAfterSignal();
122
+
}
123
+
109
124
publicfunctiontestSignalProcessNotRunning()
110
125
{
111
-
$this->skipIfPHPSigchild();
126
+
$this->setExpectedException('Symfony\Component\Process\Exception\LogicException', 'Can not send signal on a non running process.');
$this->expectExceptionIfPHPSigchild('Symfony\Component\Process\Exception\RuntimeException', 'This PHP has been compiled with --enable-sigchild. The process can not be signaled.');
134
+
} else {
135
+
$this->setExpectedException('Symfony\Component\Process\Exception\RuntimeException', 'Error while sending signal `-4`.');
$this->expectExceptionIfPHPSigchild('Symfony\Component\Process\Exception\RuntimeException', 'This PHP has been compiled with --enable-sigchild. The process can not be signaled.');
144
+
} else {
145
+
$this->setExpectedException('Symfony\Component\Process\Exception\RuntimeException', 'Error while sending signal `Céphalopodes`.');
146
+
}
130
147
parent::testSignalWithWrongNonIntSignal();
131
148
}
132
149
@@ -144,4 +161,11 @@ private function skipIfPHPSigchild()
144
161
$this->markTestSkipped('Your PHP has been compiled with --enable-sigchild, this test can not be executed');
0 commit comments