@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public function test_APPPATH() |
| 26 | 26 | { |
| 27 | 27 | $actual = realpath(APPPATH); |
| 28 | - $expected = realpath(__DIR__ . '/../..'); |
|
| 28 | + $expected = realpath(__DIR__.'/../..'); |
|
| 29 | 29 | $this->assertEquals( |
| 30 | 30 | $expected, |
| 31 | 31 | $actual, |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Part of CI PHPUnit Test |
|
| 4 | - * |
|
| 5 | - * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | - * @license MIT License |
|
| 7 | - * @copyright 2015 Kenji Suzuki |
|
| 8 | - * @link https://github.com/kenjis/ci-phpunit-test |
|
| 9 | - */ |
|
| 3 | + * Part of CI PHPUnit Test |
|
| 4 | + * |
|
| 5 | + * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | + * @license MIT License |
|
| 7 | + * @copyright 2015 Kenji Suzuki |
|
| 8 | + * @link https://github.com/kenjis/ci-phpunit-test |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | 11 | require __DIR__ . '/Installer.php'; |
| 12 | 12 | |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | elseif (strpos($class, 'CI_DB') === 0) |
| 103 | 103 | { |
| 104 | 104 | $dir = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR; |
| 105 | - $file = $dir.str_replace(array('CI_DB','active_record'), array('DB', 'active_rec'), $subclass).'.php'; |
|
| 105 | + $file = $dir.str_replace(array('CI_DB', 'active_record'), array('DB', 'active_rec'), $subclass).'.php'; |
|
| 106 | 106 | } |
| 107 | 107 | else |
| 108 | 108 | { |
@@ -63,8 +63,7 @@ discard block |
||
| 63 | 63 | if (strpos($class, 'Mock_') === 0) |
| 64 | 64 | { |
| 65 | 65 | $class = strtolower(str_replace(array('Mock_', '_'), array('', DIRECTORY_SEPARATOR), $class)); |
| 66 | - } |
|
| 67 | - elseif (strpos($class, 'CI_') === 0) |
|
| 66 | + } elseif (strpos($class, 'CI_') === 0) |
|
| 68 | 67 | { |
| 69 | 68 | $subclass = substr($class, 3); |
| 70 | 69 | |
@@ -72,39 +71,32 @@ discard block |
||
| 72 | 71 | { |
| 73 | 72 | $dir = SYSTEM_PATH.'core'.DIRECTORY_SEPARATOR; |
| 74 | 73 | $class = $subclass; |
| 75 | - } |
|
| 76 | - elseif (in_array($subclass, $ci_libraries)) |
|
| 74 | + } elseif (in_array($subclass, $ci_libraries)) |
|
| 77 | 75 | { |
| 78 | 76 | $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR; |
| 79 | 77 | $class = ($subclass === 'Driver_Library') ? 'Driver' : $subclass; |
| 80 | - } |
|
| 81 | - elseif (in_array($subclass, $ci_drivers)) |
|
| 78 | + } elseif (in_array($subclass, $ci_drivers)) |
|
| 82 | 79 | { |
| 83 | 80 | $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR.$subclass.DIRECTORY_SEPARATOR; |
| 84 | 81 | $class = $subclass; |
| 85 | - } |
|
| 86 | - elseif (in_array(($parent = strtok($subclass, '_')), $ci_drivers)) { |
|
| 82 | + } elseif (in_array(($parent = strtok($subclass, '_')), $ci_drivers)) { |
|
| 87 | 83 | $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR.$parent.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR; |
| 88 | 84 | $class = $subclass; |
| 89 | - } |
|
| 90 | - elseif (preg_match('/^CI_DB_(.+)_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 4) |
|
| 85 | + } elseif (preg_match('/^CI_DB_(.+)_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 4) |
|
| 91 | 86 | { |
| 92 | 87 | $driver_path = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR; |
| 93 | 88 | $dir = $driver_path.$m[1].DIRECTORY_SEPARATOR.'subdrivers'.DIRECTORY_SEPARATOR; |
| 94 | 89 | $file = $dir.$m[1].'_'.$m[2].'_'.$m[3].'.php'; |
| 95 | - } |
|
| 96 | - elseif (preg_match('/^CI_DB_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 3) |
|
| 90 | + } elseif (preg_match('/^CI_DB_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 3) |
|
| 97 | 91 | { |
| 98 | 92 | $driver_path = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR; |
| 99 | 93 | $dir = $driver_path.$m[1].DIRECTORY_SEPARATOR; |
| 100 | 94 | $file = $dir.$m[1].'_'.$m[2].'.php'; |
| 101 | - } |
|
| 102 | - elseif (strpos($class, 'CI_DB') === 0) |
|
| 95 | + } elseif (strpos($class, 'CI_DB') === 0) |
|
| 103 | 96 | { |
| 104 | 97 | $dir = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR; |
| 105 | 98 | $file = $dir.str_replace(array('CI_DB','active_record'), array('DB', 'active_rec'), $subclass).'.php'; |
| 106 | - } |
|
| 107 | - else |
|
| 99 | + } else |
|
| 108 | 100 | { |
| 109 | 101 | $class = strtolower($class); |
| 110 | 102 | } |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Part of CI PHPUnit Test |
|
| 4 | - * |
|
| 5 | - * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | - * @license MIT License |
|
| 7 | - * @copyright 2015 Kenji Suzuki |
|
| 8 | - * @link https://github.com/kenjis/ci-phpunit-test |
|
| 9 | - */ |
|
| 3 | + * Part of CI PHPUnit Test |
|
| 4 | + * |
|
| 5 | + * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | + * @license MIT License |
|
| 7 | + * @copyright 2015 Kenji Suzuki |
|
| 8 | + * @link https://github.com/kenjis/ci-phpunit-test |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | 11 | require __DIR__ . '/Installer.php'; |
| 12 | 12 | |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | * @link https://github.com/kenjis/ci-phpunit-test |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -require __DIR__ . '/Installer.php'; |
|
| 11 | +require __DIR__.'/Installer.php'; |
|
| 12 | 12 | |
| 13 | 13 | $installer = new Installer(); |
| 14 | 14 | $installer->update(); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | * @link https://github.com/kenjis/ci-phpunit-test |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -require __DIR__ . '/Installer.php'; |
|
| 11 | +require __DIR__.'/Installer.php'; |
|
| 12 | 12 | |
| 13 | 13 | $installer = new Installer(); |
| 14 | 14 | $installer->update(); |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Part of CI PHPUnit Test |
|
| 4 | - * |
|
| 5 | - * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | - * @license MIT License |
|
| 7 | - * @copyright 2015 Kenji Suzuki |
|
| 8 | - * @link https://github.com/kenjis/ci-phpunit-test |
|
| 9 | - */ |
|
| 3 | + * Part of CI PHPUnit Test |
|
| 4 | + * |
|
| 5 | + * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | + * @license MIT License |
|
| 7 | + * @copyright 2015 Kenji Suzuki |
|
| 8 | + * @link https://github.com/kenjis/ci-phpunit-test |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | 11 | require __DIR__ . '/Installer.php'; |
| 12 | 12 | |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Part of CI PHPUnit Test |
|
| 4 | - * |
|
| 5 | - * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | - * @license MIT License |
|
| 7 | - * @copyright 2015 Kenji Suzuki |
|
| 8 | - * @link https://github.com/kenjis/ci-phpunit-test |
|
| 9 | - */ |
|
| 3 | + * Part of CI PHPUnit Test |
|
| 4 | + * |
|
| 5 | + * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | + * @license MIT License |
|
| 7 | + * @copyright 2015 Kenji Suzuki |
|
| 8 | + * @link https://github.com/kenjis/ci-phpunit-test |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | 11 | require __DIR__ . '/Installer.php'; |
| 12 | 12 | |
@@ -38,8 +38,7 @@ |
||
| 38 | 38 | { |
| 39 | 39 | $patched = true; |
| 40 | 40 | $new_source = static::generateNewSource($source); |
| 41 | - } |
|
| 42 | - else |
|
| 41 | + } else |
|
| 43 | 42 | { |
| 44 | 43 | $new_source = $source; |
| 45 | 44 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | return $this->$name; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - throw new LogicException('No such property: ' . $name); |
|
| 44 | + throw new LogicException('No such property: '.$name); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public static function setUpBeforeClass() |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | public function resetInstance() |
| 61 | 61 | { |
| 62 | 62 | reset_instance(); |
| 63 | - if (! CIPHPUnitTest::wiredesignzHmvcInstalled()) |
|
| 63 | + if ( ! CIPHPUnitTest::wiredesignzHmvcInstalled()) |
|
| 64 | 64 | { |
| 65 | 65 | new CI_Controller(); |
| 66 | 66 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | new CI(); |
| 70 | 70 | new MX_Controller(); |
| 71 | 71 | } |
| 72 | - $this->CI =& get_instance(); |
|
| 72 | + $this->CI = & get_instance(); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | protected function tearDown() |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | $this->assertSame( |
| 245 | 245 | $code, |
| 246 | 246 | $actual, |
| 247 | - 'Status code is not ' . $code . ' but ' . $actual . '.' |
|
| 247 | + 'Status code is not '.$code.' but '.$actual.'.' |
|
| 248 | 248 | ); |
| 249 | 249 | } |
| 250 | 250 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | public function assertResponseHeader($name, $value) |
| 258 | 258 | { |
| 259 | - $CI =& get_instance(); |
|
| 259 | + $CI = & get_instance(); |
|
| 260 | 260 | $actual = $CI->output->get_header($name); |
| 261 | 261 | |
| 262 | 262 | if ($actual === null) |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | */ |
| 281 | 281 | public function assertResponseCookie($name, $value, $allow_duplicate = false) |
| 282 | 282 | { |
| 283 | - $CI =& get_instance(); |
|
| 283 | + $CI = & get_instance(); |
|
| 284 | 284 | $cookies = isset($CI->output->_cookies[$name]) |
| 285 | 285 | ? $CI->output->_cookies[$name] : null; |
| 286 | 286 | |
@@ -338,18 +338,18 @@ discard block |
||
| 338 | 338 | $this->fail('redirect() is not called.'); |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | - if (! function_exists('site_url')) |
|
| 341 | + if ( ! function_exists('site_url')) |
|
| 342 | 342 | { |
| 343 | - $CI =& get_instance(); |
|
| 343 | + $CI = & get_instance(); |
|
| 344 | 344 | $CI->load->helper('url'); |
| 345 | 345 | } |
| 346 | 346 | $absolute_url = site_url($uri); |
| 347 | - $expected = 'Redirect to ' . $absolute_url; |
|
| 347 | + $expected = 'Redirect to '.$absolute_url; |
|
| 348 | 348 | |
| 349 | 349 | $this->assertSame( |
| 350 | 350 | $expected, |
| 351 | 351 | $status['redirect'], |
| 352 | - 'URL to redirect is not ' . $expected . ' but ' . $status['redirect'] . '.' |
|
| 352 | + 'URL to redirect is not '.$expected.' but '.$status['redirect'].'.' |
|
| 353 | 353 | ); |
| 354 | 354 | |
| 355 | 355 | if ($code !== null) |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | $this->assertSame( |
| 358 | 358 | $code, |
| 359 | 359 | $status['code'], |
| 360 | - 'Status code is not ' . $code . ' but ' . $status['code'] . '.' |
|
| 360 | + 'Status code is not '.$code.' but '.$status['code'].'.' |
|
| 361 | 361 | ); |
| 362 | 362 | } |
| 363 | 363 | } |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Part of CI PHPUnit Test |
|
| 4 | - * |
|
| 5 | - * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | - * @license MIT License |
|
| 7 | - * @copyright 2015 Kenji Suzuki |
|
| 8 | - * @link https://github.com/kenjis/ci-phpunit-test |
|
| 9 | - */ |
|
| 3 | + * Part of CI PHPUnit Test |
|
| 4 | + * |
|
| 5 | + * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | + * @license MIT License |
|
| 7 | + * @copyright 2015 Kenji Suzuki |
|
| 8 | + * @link https://github.com/kenjis/ci-phpunit-test |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | 11 | require __DIR__ . '/Installer.php'; |
| 12 | 12 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | // methods in it. But we can't use them in |
| 45 | 45 | // `$this->request->setCallablePreConstructor()` |
| 46 | 46 | $mock = $this->testCase->getMockBuilder($classname); |
| 47 | - if (! $enable_constructor) |
|
| 47 | + if ( ! $enable_constructor) |
|
| 48 | 48 | { |
| 49 | 49 | $mock->disableOriginalConstructor(); |
| 50 | 50 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | break; |
| 97 | 97 | default: |
| 98 | 98 | throw new RuntimeException( |
| 99 | - 'Sorry, ' . $count . ' params not implemented yet' |
|
| 99 | + 'Sorry, '.$count.' params not implemented yet' |
|
| 100 | 100 | ); |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Part of CI PHPUnit Test |
|
| 4 | - * |
|
| 5 | - * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | - * @license MIT License |
|
| 7 | - * @copyright 2015 Kenji Suzuki |
|
| 8 | - * @link https://github.com/kenjis/ci-phpunit-test |
|
| 9 | - */ |
|
| 3 | + * Part of CI PHPUnit Test |
|
| 4 | + * |
|
| 5 | + * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | + * @license MIT License |
|
| 7 | + * @copyright 2015 Kenji Suzuki |
|
| 8 | + * @link https://github.com/kenjis/ci-phpunit-test |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | 11 | require __DIR__ . '/Installer.php'; |
| 12 | 12 | |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function getRoute() |
| 21 | 21 | { |
| 22 | - $RTR =& load_class('Router', 'core'); |
|
| 23 | - $URI =& load_class('URI', 'core'); |
|
| 22 | + $RTR = & load_class('Router', 'core'); |
|
| 23 | + $URI = & load_class('URI', 'core'); |
|
| 24 | 24 | |
| 25 | 25 | $e404 = FALSE; |
| 26 | 26 | $class = ucfirst($RTR->class); |
@@ -57,10 +57,10 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | // If 404, CodeIgniter instance is not created yet. So create it here. |
| 59 | 59 | // Because we need CI->output->_status |
| 60 | - $CI =& get_instance(); |
|
| 60 | + $CI = & get_instance(); |
|
| 61 | 61 | if ($CI instanceof CIPHPUnitTestNullCodeIgniter) |
| 62 | 62 | { |
| 63 | - if (! CIPHPUnitTest::wiredesignzHmvcInstalled()) |
|
| 63 | + if ( ! CIPHPUnitTest::wiredesignzHmvcInstalled()) |
|
| 64 | 64 | { |
| 65 | 65 | new CI_Controller(); |
| 66 | 66 | } |
@@ -29,16 +29,14 @@ discard block |
||
| 29 | 29 | if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php')) |
| 30 | 30 | { |
| 31 | 31 | $e404 = TRUE; |
| 32 | - } |
|
| 33 | - else |
|
| 32 | + } else |
|
| 34 | 33 | { |
| 35 | 34 | require_once(APPPATH.'controllers/'.$RTR->directory.$class.'.php'); |
| 36 | 35 | |
| 37 | 36 | if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method)) |
| 38 | 37 | { |
| 39 | 38 | $e404 = TRUE; |
| 40 | - } |
|
| 41 | - elseif (method_exists($class, '_remap')) |
|
| 39 | + } elseif (method_exists($class, '_remap')) |
|
| 42 | 40 | { |
| 43 | 41 | $params = array($method, array_slice($URI->rsegments, 2)); |
| 44 | 42 | $method = '_remap'; |
@@ -63,8 +61,7 @@ discard block |
||
| 63 | 61 | if (! CIPHPUnitTest::wiredesignzHmvcInstalled()) |
| 64 | 62 | { |
| 65 | 63 | new CI_Controller(); |
| 66 | - } |
|
| 67 | - else |
|
| 64 | + } else |
|
| 68 | 65 | { |
| 69 | 66 | new CI(); |
| 70 | 67 | new MX_Controller(); |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Part of CI PHPUnit Test |
|
| 4 | - * |
|
| 5 | - * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | - * @license MIT License |
|
| 7 | - * @copyright 2015 Kenji Suzuki |
|
| 8 | - * @link https://github.com/kenjis/ci-phpunit-test |
|
| 9 | - */ |
|
| 3 | + * Part of CI PHPUnit Test |
|
| 4 | + * |
|
| 5 | + * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | + * @license MIT License |
|
| 7 | + * @copyright 2015 Kenji Suzuki |
|
| 8 | + * @link https://github.com/kenjis/ci-phpunit-test |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | 11 | require __DIR__ . '/Installer.php'; |
| 12 | 12 | |