Updated unittest bootstrap to enable sysmodules

This commit is contained in:
Deon George 2015-09-29 16:17:00 +10:00
parent e29c626899
commit c8517e61da

View File

@ -15,6 +15,9 @@ $application = 'application';
*/ */
$modules = 'modules'; $modules = 'modules';
/**
* The directory in which upstream Kohana resources (modules) are located.
*/
$sysmodules = 'includes/kohana/modules'; $sysmodules = 'includes/kohana/modules';
/** /**
@ -33,15 +36,6 @@ $system = 'includes/kohana/system';
*/ */
define('EXT', '.php'); 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. * 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 * @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 * @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)) if ( ! is_dir($application) AND is_dir(DOCROOT.$application))
{ {
$application = 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)) if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules))
{ {
$modules = DOCROOT.$modules; $modules = DOCROOT.$modules;
@ -82,7 +85,7 @@ if ( ! is_dir($sysmodules) AND is_dir(DOCROOT.$sysmodules))
$sysmodules = 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)) if ( ! is_dir($system) AND is_dir(DOCROOT.$system))
{ {
$system = DOCROOT.$system; $system = DOCROOT.$system;
@ -113,7 +116,7 @@ if ( ! defined('KOHANA_START_MEMORY'))
define('KOHANA_START_MEMORY', memory_get_usage()); define('KOHANA_START_MEMORY', memory_get_usage());
} }
define('PHPUNITTEST','192.168.242.3'); define('PHPUNITTEST','hostname');
// Bootstrap the application // Bootstrap the application
require APPPATH.'bootstrap'.EXT; require APPPATH.'bootstrap'.EXT;