8000 drop non-existent working directory support · symfony/symfony@ade7c90 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit ade7c90

Browse files
committed
drop non-existent working directory support
1 parent b6e9471 commit ade7c90

File tree

3 files changed

+4
-28
lines changed

3 files changed

+4
-28
lines changed

src/Symfony/Component/Process/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ CHANGELOG
1515
* support for passing `proc_open()` options has been removed
1616
* removed the `ProcessBuilder` class, use the `Process` class instead
1717
* removed the `getEnhanceWindowsCompatibility()` and `setEnhanceWindowsCompatibility()` methods of the `Process` class
18+
* passing a not existing working directory to the constructor of the `Symfony\Component\Process\Process` class is not
19+
supported anymore
1820

1921
3.4.0
2022
-----

src/Symfony/Component/Process/Process.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,7 @@ public function start(callable $callback = null, array $env = array())
297297
}
298298

299299
if (!is_dir($this->cwd)) {
300-
if ('\\' === DIRECTORY_SEPARATOR) {
301-
throw new RuntimeException('The provided cwd does not exist.');
302-
}
303-
304-
@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);
300+
throw new RuntimeException('The provided cwd does not exist.');
305301
}
306302

307303
$this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, null, $options);

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

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -47,34 +47,12 @@ protected function tearDown()
4747
}
4848
}
4949

50-
/**
51-
* @group legacy
52-
* @expectedDeprecation 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.
53-
*/
54-
public function testInvalidCwd()
55-
{
56-
if ('\\' === DIRECTORY_SEPARATOR) {
57-
$this->markTestSkipped('Windows handles this automatically.');
58-
}
59-
60-
// Check that it works fine if the CWD exists
61-
$cmd = new Process('echo test', __DIR__);
62-
$cmd->run();
63-
64-
$cmd = new Process('echo test', __DIR__.'/notfound/');
65-
$cmd->run();
66-
}
67-
6850
/**
6951
* @expectedException \Symfony\Component\Process\Exception\RuntimeException
7052
* @expectedExceptionMessage The provided cwd does not exist.
7153
*/
72-
public function testInvalidCwdOnWindows()
54+
public function testInvalidCwd()
7355
{
74-
if ('\\' !== DIRECTORY_SEPARATOR) {
75-
$this->markTestSkipped('Unix handles this automatically.');
76-
}
77-
7856
try {
7957
// Check that it works fine if the CWD exists
8058
$cmd = new Process('echo test', __DIR__);

0 commit comments

Comments
 (0)
0