Permalink
Browse files

Whitespace, comments, and code coverage tweaks

Signed-off-by: dchill42 <dchill42@gmail.com>
  • Loading branch information...
1 parent 0c31b22 commit b069d729c86ce12738aba25ba35b2682677814f1 @dchill42 committed Oct 1, 2012
View
@@ -9,7 +9,7 @@
* Licensed under the Open Software License version 3.0
*
* This source file is subject to the Open Software License (OSL 3.0) that is
- * bundled with this package in the files license.txt / license.rst. It is
+ * bundled with this package in the files license.txt / license.rst. It is
* also available through the world wide web at this URL:
* http://opensource.org/licenses/OSL-3.0
* If you did not receive a copy of the license and are unable to obtain it
@@ -36,9 +36,9 @@
*
* This can be set to anything, but default usage is:
*
- * development
- * testing
- * production
+ * development
+ * testing
+ * production
*
* NOTE: If you change these, also change the error_reporting() code below
*/
@@ -76,7 +76,7 @@
*---------------------------------------------------------------
*
* This variable must contain the name of your "system" folder.
- * Include the path if the folder is not in the same directory
+ * Include the path if the folder is not in the same directory
* as this file.
*/
$system_path = 'system';
@@ -131,19 +131,19 @@
*
* Un-comment the $routing array below to use this feature
*/
- // The directory name, relative to the "controllers" folder. Leave blank
+ // The directory name, relative to the "controllers" folder. Leave blank
// if your controller is not in a sub-folder within the "controllers" folder
// $routing['directory'] = '';
- // The controller class file name. Example: mycontroller
+ // The controller class file name. Example: mycontroller
// $routing['controller'] = '';
// The controller function you wish to be called.
// $routing['function'] = '';
/*
* -------------------------------------------------------------------
- * CUSTOM CONFIG VALUES
+ * CUSTOM CONFIG VALUES
* -------------------------------------------------------------------
*
* The $assign_to_config array below will be passed dynamically to the
@@ -160,12 +160,12 @@
// --------------------------------------------------------------------
-// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
+// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
// --------------------------------------------------------------------
/*
* ---------------------------------------------------------------
- * Resolve the system path for increased reliability
+ * Resolve the system path for increased reliability
* ---------------------------------------------------------------
*/
@@ -192,7 +192,7 @@
{
$path = rtrim($path, '\/').'/'.$system_path;
if (is_dir($path))
- {
+ {
$system_path = $path;
$found = TRUE;
break;
@@ -208,7 +208,7 @@
/*
* -------------------------------------------------------------------
- * Now that we know the path, set the main path constants
+ * Now that we know the path, set the main path constants
* -------------------------------------------------------------------
*/
// The name of THIS file
@@ -284,4 +284,4 @@
CodeIgniter::instance()->run();
/* End of file index.php */
-/* Location: ./index.php */
+/* Location: ./index.php */
@@ -166,6 +166,7 @@ protected function __construct($config, $autoload, $basepath, $apppath)
/**
* Destructor
*
+ * @codeCoverageIgnore
* @return void
*/
public function __destruct()
@@ -328,6 +329,8 @@ public static function resolve_path($path)
* PHP < 5.3 get_called_class() is not available. For unit testing, this
* function can be overloaded in the mock class to return that class
* name for instantiation instead of CodeIgniter.
+ *
+ * @codeCoverageIgnore
*/
protected static function _get_class()
{
@@ -342,6 +345,7 @@ protected static function _get_class()
* before show_error can be called. It provides a mechanism
* for unit tests to override the exit calls.
*
+ * @codeCoverageIgnore
* @param int Status code
* @param string Exit message
* @return void
@@ -547,6 +551,7 @@ public function call_controller($class, $method, array $args = array(), $name =
* of the sequence in an extension class, and to unit test the operations
* in smaller chunks.
*
+ * @codeCoverageIgnore
* @return void
*/
public function run()
@@ -764,6 +769,7 @@ protected function _finalize()
* in place, and may not want this registered for all the other unit
* tests.
*
+ * @codeCoverageIgnore
* @return void
*/
protected function _catch_exceptions()
@@ -816,6 +822,10 @@ public function _exception_handler($severity, $message, $filepath, $line)
/**
* Global function to get CodeIgniter instance
*
+ * For unit testing, this should be overridden to return the
+ * CI_TestCase instance object instead
+ *
+ * @codeCoverageIgnore
* @return object CodeIgniter instance
*/
function &get_instance()
View
@@ -120,7 +120,7 @@ function is_really_writable($file)
* Load class
*
* This function returns classes loaded in the core CodeIgniter object.
- * DEPRECATED - get object from CodeIgniter::instance() directly
+ * DEPRECATED - get object from CodeIgniter::instance() directly
* Core classes are loaded internally, and all others should call CI_Loader.
*
* @param string the class name being requested
@@ -152,7 +152,7 @@ function &load_class($class, $directory = 'libraries', $prefix = 'CI_')
/**
* Checks if a class is loaded
*
- * DEPRECATED - check object with CodeIgniter::instance() directly
+ * DEPRECATED - check object with CodeIgniter::instance() directly
*
* @param string
* @return array
View
@@ -73,11 +73,13 @@ class CI_Config {
* Sets the $config data from CodeIgniter::_core_config as a class variable.
* This is the contents of the primary config.php file with $assign_to_config
* overrides applied.
+ *
+ * @return void
*/
public function __construct()
{
// Take over core config
- $CI = get_instance();
+ $CI = get_instance(); // Use get_instance() for unit test override
$this->config = $CI->_core_config;
unset($CI->_core_config);
@@ -52,7 +52,7 @@ class CI_Controller {
*/
public function __construct()
{
- $this->CI = get_instance();
+ $this->CI = get_instance(); // Use get_instance() for unit test override
log_message('debug', 'Controller Class Initialized');
}
@@ -209,7 +209,7 @@ protected function _route_error($route, $template, $args = NULL)
}
// Check Router for an override
- $CI =& get_instance();
+ $CI =& get_instance(); // Use get_instance() for unit test override
if (isset($CI->router))
{
$stack = $CI->router->get_error_route($route);
View
@@ -66,7 +66,7 @@ class CI_Hooks {
*/
public function __construct()
{
- $CI =& get_instance();
+ $CI =& get_instance(); // Use get_instance() for unit test override
log_message('debug', 'Hooks Class Initialized');
View
@@ -101,7 +101,7 @@ public function __construct()
{
log_message('debug', 'Input Class Initialized');
- $CI =& get_instance();
+ $CI =& get_instance(); // Use get_instance() for unit test override
$this->security =& $CI->security;
$this->_allow_get_array = ($CI->config->item('allow_get_array') === TRUE);
View
@@ -85,7 +85,7 @@ public function load($langfile, $idiom = '', $return = FALSE, $add_suffix = TRUE
if ($idiom === '')
{
- $CI = get_instance();
+ $CI = get_instance(); // Use get_instance() for unit test override
$cfg_lang = $CI->config->item('language');
$idiom = ( ! empty($cfg_lang)) ? $cfg_lang : 'english';
}
Oops, something went wrong.

0 comments on commit b069d72

Please sign in to comment.