From c8517e61da035c510e9fdbefa4efd2e64dcb0dfe Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 29 Sep 2015 16:17:00 +1000 Subject: [PATCH] Updated unittest bootstrap to enable sysmodules --- modules/unittest/bootstrap.php | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/modules/unittest/bootstrap.php b/modules/unittest/bootstrap.php index 2abe238..1974831 100644 --- a/modules/unittest/bootstrap.php +++ b/modules/unittest/bootstrap.php @@ -15,6 +15,9 @@ $application = 'application'; */ $modules = 'modules'; +/** + * The directory in which upstream Kohana resources (modules) are located. + */ $sysmodules = 'includes/kohana/modules'; /** @@ -33,15 +36,6 @@ $system = 'includes/kohana/system'; */ define('EXT', '.php'); -/** - * Set the path to the document root - * - * This assumes that this file is stored 2 levels below the DOCROOT, if you move - * this bootstrap file somewhere else then you'll need to modify this value to - * compensate. - */ -define('DOCROOT', realpath(dirname(__FILE__).'/../../').DIRECTORY_SEPARATOR); - /** * Set the PHP error reporting level. If you set this in php.ini, you remove this. * @link http://www.php.net/manual/errorfunc.configuration#ini.error-reporting @@ -64,13 +58,22 @@ error_reporting(E_ALL | E_STRICT); * @link http://kohanaframework.org/guide/using.configuration */ -// Make the application relative to the docroot +/** + * This assumes that this file is stored 2 levels below the DOCROOT, if you move + * this bootstrap file somewhere else then you'll need to modify this value to + * compensate. + */ + +// Set the full path to the docroot +define('DOCROOT', realpath(dirname(__FILE__).'/../../../../').DIRECTORY_SEPARATOR); + +// Make the application relative to the docroot, for symlink'd index.php if ( ! is_dir($application) AND is_dir(DOCROOT.$application)) { $application = DOCROOT.$application; } -// Make the modules relative to the docroot +// Make the modules relative to the docroot, for symlink'd index.php if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules)) { $modules = DOCROOT.$modules; @@ -82,7 +85,7 @@ if ( ! is_dir($sysmodules) AND is_dir(DOCROOT.$sysmodules)) $sysmodules = DOCROOT.$sysmodules; } -// Make the system relative to the docroot +// Make the system relative to the docroot, for symlink'd index.php if ( ! is_dir($system) AND is_dir(DOCROOT.$system)) { $system = DOCROOT.$system; @@ -113,7 +116,7 @@ if ( ! defined('KOHANA_START_MEMORY')) define('KOHANA_START_MEMORY', memory_get_usage()); } -define('PHPUNITTEST','192.168.242.3'); +define('PHPUNITTEST','hostname'); // Bootstrap the application require APPPATH.'bootstrap'.EXT;