Skip to content

Commit

Permalink
bug #25447 [Process] remove false-positive BC breaking exception on W…
Browse files Browse the repository at this point in the history
…indows (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
  • Loading branch information
fabpot committed Dec 11, 2017
2 parents 5b66c26 + fe41155 commit f07430f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
4 changes: 0 additions & 4 deletions src/Symfony/Component/Process/Process.php
Expand Up @@ -331,10 +331,6 @@ 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);
}

Expand Down
26 changes: 0 additions & 26 deletions src/Symfony/Component/Process/Tests/ProcessTest.php
Expand Up @@ -54,10 +54,6 @@ protected function tearDown()
*/
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();
Expand All @@ -66,28 +62,6 @@ public function testInvalidCwd()
$cmd->run();
}

/**
* @expectedException \Symfony\Component\Process\Exception\RuntimeException
* @expectedExceptionMessage The provided cwd does not exist.
*/
public function testInvalidCwdOnWindows()
{
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__);
$cmd->run();
} catch (\Exception $e) {
$this->fail($e);
}

$cmd = new Process('echo test', __DIR__.'/notfound/');
$cmd->run();
}

public function testThatProcessDoesNotThrowWarningDuringRun()
{
if ('\\' === DIRECTORY_SEPARATOR) {
Expand Down

0 comments on commit f07430f

Please sign in to comment.