fix testing of the core.

This commit is contained in:
Taylor Otwell 2012-01-27 16:28:17 -06:00
parent f44c565ee4
commit a351e91aef
2 changed files with 16 additions and 10 deletions

View File

@ -35,16 +35,6 @@ public function core()
$path = $GLOBALS['BUNDLE_PATH'].'laravel-tests/'; $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(); $this->test();
} }

View File

@ -18,6 +18,22 @@
// -------------------------------------------------------------- // --------------------------------------------------------------
require 'paths.php'; 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. // Bootstrap the Laravel core.
// -------------------------------------------------------------- // --------------------------------------------------------------