Skip to content

Commit f07430f

Browse files
committed
bug #25447 [Process] remove false-positive BC breaking exception on Windows (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [Process] remove false-positive BC breaking exception on Windows | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #25446 | License | MIT | Doc PR | - Commits ------- fe41155 [Process] remove false-positive BC breaking exception on Windows
2 parents 5b66c26 + fe41155 commit f07430f

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

src/Symfony/Component/Process/Process.php

-4
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,6 @@ public function start(callable $callback = null/*, array $env = array()*/)
331331
}
332332

333333
if (!is_dir($this->cwd)) {
334-
if ('\\' === DIRECTORY_SEPARATOR) {
335-
throw new RuntimeException('The provided cwd does not exist.');
336-
}
337-
338334
@trigger_error('The provided cwd does not exist. Command is currently ran against getcwd(). This behavior is deprecated since version 3.4 and will be removed in 4.0.', E_USER_DEPRECATED);
339335
}
340336

src/Symfony/Component/Process/Tests/ProcessTest.php

-26
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ protected function tearDown()
5454
*/
5555
public function testInvalidCwd()
5656
{
57-
if ('\\' === DIRECTORY_SEPARATOR) {
58-
$this->markTestSkipped('Windows handles this automatically.');
59-
}
60-
6157
// Check that it works fine if the CWD exists
6258
$cmd = new Process('echo test', __DIR__);
6359
$cmd->run();
@@ -66,28 +62,6 @@ public function testInvalidCwd()
6662
$cmd->run();
6763
}
6864

69-
/**
70-
* @expectedException \Symfony\Component\Process\Exception\RuntimeException
71-
* @expectedExceptionMessage The provided cwd does not exist.
72-
*/
73-
public function testInvalidCwdOnWindows()
74-
{
75-
if ('\\' !== DIRECTORY_SEPARATOR) {
76-
$this->markTestSkipped('Unix handles this automatically.');
77-
}
78-
79-
try {
80-
// Check that it works fine if the CWD exists
81-
$cmd = new Process('echo test', __DIR__);
82-
$cmd->run();
83-
} catch (\Exception $e) {
84-
$this->fail($e);
85-
}
86-
87-
$cmd = new Process('echo test', __DIR__.'/notfound/');
88-
$cmd->run();
89-
}
90-
9165
public function testThatProcessDoesNotThrowWarningDuringRun()
9266
{
9367
if ('\\' === DIRECTORY_SEPARATOR) {

0 commit comments

Comments
 (0)