From ad2540c979bc20a9a4a52fbea7efd58da5baf7bd Mon Sep 17 00:00:00 2001 From: Luca Degasperi Date: Wed, 27 Jun 2012 15:20:28 +0200 Subject: [PATCH 1/2] Fixed the spaced directory when calling php unit via the command line Signed-off-by: Luca Degasperi --- laravel/cli/tasks/test/runner.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/laravel/cli/tasks/test/runner.php b/laravel/cli/tasks/test/runner.php index 85787896..e13a42d9 100644 --- a/laravel/cli/tasks/test/runner.php +++ b/laravel/cli/tasks/test/runner.php @@ -80,6 +80,9 @@ protected function test() // pointing to our temporary configuration file. This allows // us to flexibly run tests for any setup. $path = path('base').'phpunit.xml'; + + // fix the spaced directories problem when using the command line + $path = str_replace(" ", "\\ ", $path); passthru('phpunit --configuration '.$path); From 79a5dc19313c31ec0e109730a0b20389d3bfcd63 Mon Sep 17 00:00:00 2001 From: Luca Degasperi Date: Wed, 27 Jun 2012 17:31:38 +0200 Subject: [PATCH 2/2] Using escapeshellarg instead of putting backshlashes in front of spaces Signed-off-by: Luca Degasperi --- laravel/cli/tasks/test/runner.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/laravel/cli/tasks/test/runner.php b/laravel/cli/tasks/test/runner.php index e13a42d9..953c9857 100644 --- a/laravel/cli/tasks/test/runner.php +++ b/laravel/cli/tasks/test/runner.php @@ -82,7 +82,8 @@ protected function test() $path = path('base').'phpunit.xml'; // fix the spaced directories problem when using the command line - $path = str_replace(" ", "\\ ", $path); + // strings with spaces inside should be wrapped in quotes. + $path = escapeshellarg($path) passthru('phpunit --configuration '.$path);