@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | public function enableHooks() |
| 117 | 117 | { |
| 118 | 118 | $this->enableHooks = true; |
| 119 | - $this->hooks =& load_class('Hooks', 'core'); |
|
| 119 | + $this->hooks = & load_class('Hooks', 'core'); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | { |
| 163 | 163 | set_status_header($e->getCode()); |
| 164 | 164 | } |
| 165 | - $CI =& get_instance(); |
|
| 165 | + $CI = & get_instance(); |
|
| 166 | 166 | $CI->output->_status['redirect'] = $e->getMessage(); |
| 167 | 167 | } |
| 168 | 168 | // show_404() |
@@ -224,17 +224,17 @@ discard block |
||
| 224 | 224 | $this->setRawInputStream($request_params); |
| 225 | 225 | |
| 226 | 226 | // 404 checking |
| 227 | - if (! class_exists($class) || ! method_exists($class, $method)) |
|
| 227 | + if ( ! class_exists($class) || ! method_exists($class, $method)) |
|
| 228 | 228 | { |
| 229 | 229 | // If 404, CodeIgniter instance is not created yet. So create it here |
| 230 | 230 | // Because we need CI->output->_status to store info |
| 231 | - $CI =& get_instance(); |
|
| 231 | + $CI = & get_instance(); |
|
| 232 | 232 | if ($CI instanceof CIPHPUnitTestNullCodeIgniter) |
| 233 | 233 | { |
| 234 | 234 | CIPHPUnitTest::createCodeIgniterInstance(); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | - show_404($class.'::'.$method . '() is not found'); |
|
| 237 | + show_404($class.'::'.$method.'() is not found'); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | $params = $argv; |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | { |
| 297 | 297 | if (is_string($string)) |
| 298 | 298 | { |
| 299 | - $INPUT =& load_class('Input', 'core'); |
|
| 299 | + $INPUT = & load_class('Input', 'core'); |
|
| 300 | 300 | CIPHPUnitTestReflection::setPrivateProperty( |
| 301 | 301 | $INPUT, |
| 302 | 302 | '_raw_input_stream', |
@@ -326,12 +326,12 @@ discard block |
||
| 326 | 326 | new CI(); |
| 327 | 327 | } |
| 328 | 328 | $controller = new $class; |
| 329 | - $CI =& get_instance(); |
|
| 329 | + $CI = & get_instance(); |
|
| 330 | 330 | |
| 331 | 331 | // Set CodeIgniter instance to TestCase |
| 332 | 332 | $this->testCase->setCI($CI); |
| 333 | 333 | |
| 334 | - if (! isset($CI->output->_status)) |
|
| 334 | + if ( ! isset($CI->output->_status)) |
|
| 335 | 335 | { |
| 336 | 336 | // Prevent overwriting, if already set in the $class::__construct() |
| 337 | 337 | // Set default response code 200 |
@@ -377,8 +377,8 @@ discard block |
||
| 377 | 377 | */ |
| 378 | 378 | public function getStatus() |
| 379 | 379 | { |
| 380 | - $CI =& get_instance(); |
|
| 381 | - if (! isset($CI->output->_status)) |
|
| 380 | + $CI = & get_instance(); |
|
| 381 | + if ( ! isset($CI->output->_status)) |
|
| 382 | 382 | { |
| 383 | 383 | throw new LogicException('Status code is not set. You must call $this->request() first'); |
| 384 | 384 | } |
@@ -33,30 +33,30 @@ discard block |
||
| 33 | 33 | $cwd_backup = getcwd(); |
| 34 | 34 | |
| 35 | 35 | // Load autoloader for ci-phpunit-test |
| 36 | - require __DIR__ . '/autoloader.php'; |
|
| 36 | + require __DIR__.'/autoloader.php'; |
|
| 37 | 37 | |
| 38 | - require APPPATH . '/tests/TestCase.php'; |
|
| 38 | + require APPPATH.'/tests/TestCase.php'; |
|
| 39 | 39 | |
| 40 | - $db_test_case_file = APPPATH . '/tests/DbTestCase.php'; |
|
| 40 | + $db_test_case_file = APPPATH.'/tests/DbTestCase.php'; |
|
| 41 | 41 | if (is_readable($db_test_case_file)) |
| 42 | 42 | { |
| 43 | 43 | require $db_test_case_file; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // Replace a few Common functions |
| 47 | - require __DIR__ . '/replacing/core/Common.php'; |
|
| 48 | - require BASEPATH . 'core/Common.php'; |
|
| 47 | + require __DIR__.'/replacing/core/Common.php'; |
|
| 48 | + require BASEPATH.'core/Common.php'; |
|
| 49 | 49 | |
| 50 | 50 | // Workaround for missing CodeIgniter's error handler |
| 51 | 51 | // See https://github.com/kenjis/ci-phpunit-test/issues/37 |
| 52 | 52 | set_error_handler('_error_handler'); |
| 53 | 53 | |
| 54 | 54 | // Load new functions of CIPHPUnitTest |
| 55 | - require __DIR__ . '/functions.php'; |
|
| 55 | + require __DIR__.'/functions.php'; |
|
| 56 | 56 | // Load ci-phpunit-test CI_Loader |
| 57 | - require __DIR__ . '/replacing/core/Loader.php'; |
|
| 57 | + require __DIR__.'/replacing/core/Loader.php'; |
|
| 58 | 58 | // Load ci-phpunit-test CI_Input |
| 59 | - require __DIR__ . '/replacing/core/Input.php'; |
|
| 59 | + require __DIR__.'/replacing/core/Input.php'; |
|
| 60 | 60 | |
| 61 | 61 | // Change current directory |
| 62 | 62 | chdir(FCPATH); |
@@ -68,12 +68,12 @@ discard block |
||
| 68 | 68 | * |
| 69 | 69 | * And away we go... |
| 70 | 70 | */ |
| 71 | - require __DIR__ . '/replacing/core/CodeIgniter.php'; |
|
| 71 | + require __DIR__.'/replacing/core/CodeIgniter.php'; |
|
| 72 | 72 | |
| 73 | 73 | self::replaceHelpers(); |
| 74 | 74 | |
| 75 | 75 | // Create CodeIgniter instance |
| 76 | - if (! self::wiredesignzHmvcInstalled()) |
|
| 76 | + if ( ! self::wiredesignzHmvcInstalled()) |
|
| 77 | 77 | { |
| 78 | 78 | new CI_Controller(); |
| 79 | 79 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | public static function createCodeIgniterInstance() |
| 96 | 96 | { |
| 97 | - if (! self::wiredesignzHmvcInstalled()) |
|
| 97 | + if ( ! self::wiredesignzHmvcInstalled()) |
|
| 98 | 98 | { |
| 99 | 99 | new CI_Controller(); |
| 100 | 100 | } |
@@ -123,11 +123,11 @@ discard block |
||
| 123 | 123 | protected static function replaceLoader() |
| 124 | 124 | { |
| 125 | 125 | $my_loader_file = |
| 126 | - APPPATH . 'core/' . config_item('subclass_prefix') . 'Loader.php'; |
|
| 126 | + APPPATH.'core/'.config_item('subclass_prefix').'Loader.php'; |
|
| 127 | 127 | |
| 128 | 128 | if (file_exists($my_loader_file)) |
| 129 | 129 | { |
| 130 | - self::$loader_class = config_item('subclass_prefix') . 'Loader'; |
|
| 130 | + self::$loader_class = config_item('subclass_prefix').'Loader'; |
|
| 131 | 131 | if ( ! class_exists(self::$loader_class)) |
| 132 | 132 | { |
| 133 | 133 | require $my_loader_file; |
@@ -146,19 +146,19 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | protected static function loadHelper($helper) |
| 148 | 148 | { |
| 149 | - $my_helper_file = APPPATH . 'helpers/' . config_item('subclass_prefix') . $helper . '.php'; |
|
| 149 | + $my_helper_file = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php'; |
|
| 150 | 150 | if (file_exists($my_helper_file)) |
| 151 | 151 | { |
| 152 | 152 | require $my_helper_file; |
| 153 | 153 | } |
| 154 | - require __DIR__ . '/replacing/helpers/' . $helper . '.php'; |
|
| 154 | + require __DIR__.'/replacing/helpers/'.$helper.'.php'; |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | public static function setPatcherCacheDir($dir = null) |
| 158 | 158 | { |
| 159 | 159 | if ($dir === null) |
| 160 | 160 | { |
| 161 | - $dir = APPPATH . 'tests/_ci_phpunit_test/tmp/cache'; |
|
| 161 | + $dir = APPPATH.'tests/_ci_phpunit_test/tmp/cache'; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | MonkeyPatchManager::setCacheDir( |