@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | // Support PHPUnit 6.0 |
| 12 | -if (! class_exists('PHPUnit_Framework_TestCase')) |
|
| 12 | +if ( ! class_exists('PHPUnit_Framework_TestCase')) |
|
| 13 | 13 | { |
| 14 | 14 | class_alias('PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase'); |
| 15 | 15 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | return $this->$name; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - throw new LogicException('No such property: ' . $name); |
|
| 58 | + throw new LogicException('No such property: '.$name); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | public static function setUpBeforeClass() |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | reset_instance(); |
| 80 | 80 | CIPHPUnitTest::createCodeIgniterInstance(); |
| 81 | - $this->CI =& get_instance(); |
|
| 81 | + $this->CI = & get_instance(); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | protected function tearDown() |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $this->assertSame( |
| 259 | 259 | $code, |
| 260 | 260 | $actual, |
| 261 | - 'Status code is not ' . $code . ' but ' . $actual . '.' |
|
| 261 | + 'Status code is not '.$code.' but '.$actual.'.' |
|
| 262 | 262 | ); |
| 263 | 263 | } |
| 264 | 264 | |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | */ |
| 271 | 271 | public function assertResponseHeader($name, $value) |
| 272 | 272 | { |
| 273 | - $CI =& get_instance(); |
|
| 273 | + $CI = & get_instance(); |
|
| 274 | 274 | $actual = $CI->output->get_header($name); |
| 275 | 275 | |
| 276 | 276 | if ($actual === null) |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | public function assertResponseCookie($name, $value, $allow_duplicate = false) |
| 296 | 296 | { |
| 297 | - $CI =& get_instance(); |
|
| 297 | + $CI = & get_instance(); |
|
| 298 | 298 | $cookies = isset($CI->output->_cookies[$name]) |
| 299 | 299 | ? $CI->output->_cookies[$name] : null; |
| 300 | 300 | |
@@ -362,23 +362,23 @@ discard block |
||
| 362 | 362 | $this->fail('redirect() is not called.'); |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | - if (! function_exists('site_url')) |
|
| 365 | + if ( ! function_exists('site_url')) |
|
| 366 | 366 | { |
| 367 | - $CI =& get_instance(); |
|
| 367 | + $CI = & get_instance(); |
|
| 368 | 368 | $CI->load->helper('url'); |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | - if (! preg_match('#^(\w+:)?//#i', $uri)) |
|
| 371 | + if ( ! preg_match('#^(\w+:)?//#i', $uri)) |
|
| 372 | 372 | { |
| 373 | 373 | $uri = site_url($uri); |
| 374 | 374 | } |
| 375 | 375 | $absolute_url = $uri; |
| 376 | - $expected = 'Redirect to ' . $absolute_url; |
|
| 376 | + $expected = 'Redirect to '.$absolute_url; |
|
| 377 | 377 | |
| 378 | 378 | $this->assertSame( |
| 379 | 379 | $expected, |
| 380 | 380 | $status['redirect'], |
| 381 | - 'URL to redirect is not ' . $expected . ' but ' . $status['redirect'] . '.' |
|
| 381 | + 'URL to redirect is not '.$expected.' but '.$status['redirect'].'.' |
|
| 382 | 382 | ); |
| 383 | 383 | |
| 384 | 384 | if ($code !== null) |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | $this->assertSame( |
| 387 | 387 | $code, |
| 388 | 388 | $status['code'], |
| 389 | - 'Status code is not ' . $code . ' but ' . $status['code'] . '.' |
|
| 389 | + 'Status code is not '.$code.' but '.$status['code'].'.' |
|
| 390 | 390 | ); |
| 391 | 391 | } |
| 392 | 392 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | { |
| 21 | 21 | reset_instance(); |
| 22 | 22 | $controller = new $classname; |
| 23 | - $this->CI =& get_instance(); |
|
| 23 | + $this->CI = & get_instance(); |
|
| 24 | 24 | return $controller; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | public static function init(array $autoload_dirs = null) |
| 22 | 22 | { |
| 23 | - if (! defined('TESTPATH')) { |
|
| 23 | + if ( ! defined('TESTPATH')) { |
|
| 24 | 24 | define('TESTPATH', APPPATH.'tests'.DIRECTORY_SEPARATOR); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -37,36 +37,36 @@ discard block |
||
| 37 | 37 | $cwd_backup = getcwd(); |
| 38 | 38 | |
| 39 | 39 | // Load autoloader for ci-phpunit-test |
| 40 | - require __DIR__ . '/autoloader.php'; |
|
| 40 | + require __DIR__.'/autoloader.php'; |
|
| 41 | 41 | |
| 42 | - require TESTPATH . 'TestCase.php'; |
|
| 42 | + require TESTPATH.'TestCase.php'; |
|
| 43 | 43 | |
| 44 | - $db_test_case_file = TESTPATH . 'DbTestCase.php'; |
|
| 44 | + $db_test_case_file = TESTPATH.'DbTestCase.php'; |
|
| 45 | 45 | if (is_readable($db_test_case_file)) |
| 46 | 46 | { |
| 47 | 47 | require $db_test_case_file; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - $unit_test_case_file = TESTPATH . 'UnitTestCase.php'; |
|
| 50 | + $unit_test_case_file = TESTPATH.'UnitTestCase.php'; |
|
| 51 | 51 | if (is_readable($unit_test_case_file)) |
| 52 | 52 | { |
| 53 | 53 | require $unit_test_case_file; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | // Replace a few Common functions |
| 57 | - require __DIR__ . '/replacing/core/Common.php'; |
|
| 58 | - require BASEPATH . 'core/Common.php'; |
|
| 57 | + require __DIR__.'/replacing/core/Common.php'; |
|
| 58 | + require BASEPATH.'core/Common.php'; |
|
| 59 | 59 | |
| 60 | 60 | // Workaround for missing CodeIgniter's error handler |
| 61 | 61 | // See https://github.com/kenjis/ci-phpunit-test/issues/37 |
| 62 | 62 | set_error_handler('_error_handler'); |
| 63 | 63 | |
| 64 | 64 | // Load new functions of CIPHPUnitTest |
| 65 | - require __DIR__ . '/functions.php'; |
|
| 65 | + require __DIR__.'/functions.php'; |
|
| 66 | 66 | // Load ci-phpunit-test CI_Loader |
| 67 | - require __DIR__ . '/replacing/core/Loader.php'; |
|
| 67 | + require __DIR__.'/replacing/core/Loader.php'; |
|
| 68 | 68 | // Load ci-phpunit-test CI_Input |
| 69 | - require __DIR__ . '/replacing/core/Input.php'; |
|
| 69 | + require __DIR__.'/replacing/core/Input.php'; |
|
| 70 | 70 | |
| 71 | 71 | // Change current directory |
| 72 | 72 | chdir(FCPATH); |
@@ -78,12 +78,12 @@ discard block |
||
| 78 | 78 | * |
| 79 | 79 | * And away we go... |
| 80 | 80 | */ |
| 81 | - require __DIR__ . '/replacing/core/CodeIgniter.php'; |
|
| 81 | + require __DIR__.'/replacing/core/CodeIgniter.php'; |
|
| 82 | 82 | |
| 83 | 83 | self::replaceHelpers(); |
| 84 | 84 | |
| 85 | 85 | // Create CodeIgniter instance |
| 86 | - if (! self::wiredesignzHmvcInstalled()) |
|
| 86 | + if ( ! self::wiredesignzHmvcInstalled()) |
|
| 87 | 87 | { |
| 88 | 88 | new CI_Controller(); |
| 89 | 89 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | public static function createCodeIgniterInstance() |
| 106 | 106 | { |
| 107 | - if (! self::wiredesignzHmvcInstalled()) |
|
| 107 | + if ( ! self::wiredesignzHmvcInstalled()) |
|
| 108 | 108 | { |
| 109 | 109 | new CI_Controller(); |
| 110 | 110 | } |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | protected static function replaceLoader() |
| 134 | 134 | { |
| 135 | 135 | $my_loader_file = |
| 136 | - APPPATH . 'core/' . config_item('subclass_prefix') . 'Loader.php'; |
|
| 136 | + APPPATH.'core/'.config_item('subclass_prefix').'Loader.php'; |
|
| 137 | 137 | |
| 138 | 138 | if (file_exists($my_loader_file)) |
| 139 | 139 | { |
| 140 | - self::$loader_class = config_item('subclass_prefix') . 'Loader'; |
|
| 140 | + self::$loader_class = config_item('subclass_prefix').'Loader'; |
|
| 141 | 141 | if ( ! class_exists(self::$loader_class)) |
| 142 | 142 | { |
| 143 | 143 | require $my_loader_file; |
@@ -156,19 +156,19 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | protected static function loadHelper($helper) |
| 158 | 158 | { |
| 159 | - $my_helper_file = APPPATH . 'helpers/' . config_item('subclass_prefix') . $helper . '.php'; |
|
| 159 | + $my_helper_file = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php'; |
|
| 160 | 160 | if (file_exists($my_helper_file)) |
| 161 | 161 | { |
| 162 | 162 | require $my_helper_file; |
| 163 | 163 | } |
| 164 | - require __DIR__ . '/replacing/helpers/' . $helper . '.php'; |
|
| 164 | + require __DIR__.'/replacing/helpers/'.$helper.'.php'; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | public static function setPatcherCacheDir($dir = null) |
| 168 | 168 | { |
| 169 | 169 | if ($dir === null) |
| 170 | 170 | { |
| 171 | - $dir = TESTPATH . '_ci_phpunit_test/tmp/cache'; |
|
| 171 | + $dir = TESTPATH.'_ci_phpunit_test/tmp/cache'; |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | MonkeyPatchManager::setCacheDir( |