From d27858f77b4c9d839af789ed0df6e90a2279b94c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Mon, 1 Apr 2019 15:29:45 +0200 Subject: [PATCH] [Process] Added more detail to the exception when the CWD is invalid --- src/Symfony/Component/Process/Process.php | 2 +- src/Symfony/Component/Process/Tests/ProcessTest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 8b7f539e0f..55dd0112a6 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -331,7 +331,7 @@ class Process implements \IteratorAggregate } if (!is_dir($this->cwd)) { - throw new RuntimeException('The provided cwd does not exist.'); + throw new RuntimeException(sprintf('The provided cwd "%s" does not exist.', $this->cwd)); } $this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $options); diff --git a/src/Symfony/Component/Process/Tests/ProcessTest.php b/src/Symfony/Component/Process/Tests/ProcessTest.php index 187226bd49..476456d1b0 100644 --- a/src/Symfony/Component/Process/Tests/ProcessTest.php +++ b/src/Symfony/Component/Process/Tests/ProcessTest.php @@ -49,7 +49,8 @@ class ProcessTest extends TestCase /** * @expectedException \Symfony\Component\Process\Exception\RuntimeException - * @expectedExceptionMessage The provided cwd does not exist. + * @expectedExceptionMessage The provided cwd " + * @expectedExceptionMessage "does not exist. */ public function testInvalidCwd() {