Permalink
Browse files

feature #24467 [Process] drop non-existent working directory support …

…(xabbuh)

This PR was merged into the 4.0-dev branch.

Discussion
----------

[Process] drop non-existent working directory support

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23708
| License       | MIT
| Doc PR        |

Commits
-------

ade7c90 drop non-existent working directory support
  • Loading branch information...
fabpot committed Oct 6, 2017
2 parents b6e9471 + ade7c90 commit a95fe36bfacd2e0cfd94164aae973b6242afe12f
@@ -15,6 +15,8 @@ CHANGELOG
* support for passing `proc_open()` options has been removed
* removed the `ProcessBuilder` class, use the `Process` class instead
* removed the `getEnhanceWindowsCompatibility()` and `setEnhanceWindowsCompatibility()` methods of the `Process` class
* passing a not existing working directory to the constructor of the `Symfony\Component\Process\Process` class is not
supported anymore
3.4.0
-----
@@ -297,11 +297,7 @@ public function start(callable $callback = null, array $env = array())
}
if (!is_dir($this->cwd)) {
if ('\\' === DIRECTORY_SEPARATOR) {
throw new RuntimeException('The provided cwd does not exist.');
}
@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);
throw new RuntimeException('The provided cwd does not exist.');
}
$this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, null, $options);
@@ -47,34 +47,12 @@ protected function tearDown()
}
}
/**
* @group legacy
* @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.
*/
public function testInvalidCwd()
{
if ('\\' === DIRECTORY_SEPARATOR) {
$this->markTestSkipped('Windows handles this automatically.');
}
// Check that it works fine if the CWD exists
$cmd = new Process('echo test', __DIR__);
$cmd->run();
$cmd = new Process('echo test', __DIR__.'/notfound/');
$cmd->run();
}
/**
* @expectedException \Symfony\Component\Process\Exception\RuntimeException
* @expectedExceptionMessage The provided cwd does not exist.
*/
public function testInvalidCwdOnWindows()
public function testInvalidCwd()
{
if ('\\' !== DIRECTORY_SEPARATOR) {
$this->markTestSkipped('Unix handles this automatically.');
}
try {
// Check that it works fine if the CWD exists
$cmd = new Process('echo test', __DIR__);

0 comments on commit a95fe36

Please sign in to comment.