From a351e91aef08fef33c2b9294ea103050ceae7f81 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 27 Jan 2012 16:28:17 -0600 Subject: [PATCH] fix testing of the core. --- laravel/cli/tasks/test/runner.php | 10 ---------- phpunit.php | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/laravel/cli/tasks/test/runner.php b/laravel/cli/tasks/test/runner.php index 02307b9c..60a2ec4b 100644 --- a/laravel/cli/tasks/test/runner.php +++ b/laravel/cli/tasks/test/runner.php @@ -35,16 +35,6 @@ public function core() $path = $GLOBALS['BUNDLE_PATH'].'laravel-tests/'; - // When testing the framework, we will swap out the application - // and other core paths to stub out the application portion of - // the framework for testing. This allows us to create dummy - // controllers, views, models, etc. - $GLOBALS['APP_PATH'] = $path.'application'.DS; - - $GLOBALS['BUNDLE_PATH'] = $path.'bundles'.DS; - - $GLOBALS['STORAGE_PATH'] = $path.'storage'.DS; - $this->test(); } diff --git a/phpunit.php b/phpunit.php index d9ea9d46..1bdb1619 100644 --- a/phpunit.php +++ b/phpunit.php @@ -18,6 +18,22 @@ // -------------------------------------------------------------- require 'paths.php'; +// -------------------------------------------------------------- +// Override the application paths when testing the core. +// -------------------------------------------------------------- +$config = file_get_contents('phpunit.xml'); + +if (strpos($config, 'laravel-tests') !== false) +{ + $path = $GLOBALS['BUNDLE_PATH'].'laravel-tests'.DS; + + $GLOBALS['APP_PATH'] = $path.'application'.DS; + + $GLOBALS['BUNDLE_PATH'] = $path.'bundles'.DS; + + $GLOBALS['STORAGE_PATH'] = $path.'storage'.DS; +} + // -------------------------------------------------------------- // Bootstrap the Laravel core. // --------------------------------------------------------------