Completed
Push — master ( 7091fd...28899b )
by Kenji
03:43
created
application/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -129,8 +129,7 @@  discard block
 block discarded – undo
129 129
 				return $this->callControllerMethod(
130 130
 					$http_method, $argv, $params
131 131
 				);
132
-			}
133
-			else
132
+			} else
134 133
 			{
135 134
 				return $this->requestUri($http_method, $argv, $params);
136 135
 			}
@@ -141,8 +140,7 @@  discard block
 block discarded – undo
141 140
 			if ($e->getCode() === 0)
142 141
 			{
143 142
 				set_status_header(200);
144
-			}
145
-			else
143
+			} else
146 144
 			{
147 145
 				set_status_header($e->getCode());
148 146
 			}
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	public function enableHooks()
96 96
 	{
97 97
 		$this->enableHooks = true;
98
-		$this->hooks =& load_class('Hooks', 'core');
98
+		$this->hooks = & load_class('Hooks', 'core');
99 99
 	}
100 100
 
101 101
 	/**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 			{
142 142
 				set_status_header($e->getCode());
143 143
 			}
144
-			$CI =& get_instance();
144
+			$CI = & get_instance();
145 145
 			$CI->output->_status['redirect'] = $e->getMessage();
146 146
 		}
147 147
 		// show_404()
@@ -197,17 +197,17 @@  discard block
 block discarded – undo
197 197
 		$this->setRawInputStream($request_params);
198 198
 
199 199
 		// 404 checking
200
-		if (! class_exists($class) || ! method_exists($class, $method))
200
+		if ( ! class_exists($class) || ! method_exists($class, $method))
201 201
 		{
202 202
 			// If 404, CodeIgniter instance is not created yet. So create it here
203 203
 			// Because we need CI->output->_status to store info
204
-			$CI =& get_instance();
204
+			$CI = & get_instance();
205 205
 			if ($CI === null)
206 206
 			{
207 207
 				new CI_Controller();
208 208
 			}
209 209
 
210
-			show_404($class.'::'.$method . '() is not found');
210
+			show_404($class.'::'.$method.'() is not found');
211 211
 		}
212 212
 
213 213
 		$params = $argv;
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 	{
267 267
 		if (is_string($string))
268 268
 		{
269
-			$INPUT =& load_class('Input', 'core');
269
+			$INPUT = & load_class('Input', 'core');
270 270
 			CIPHPUnitTestReflection::setPrivateProperty(
271 271
 				$INPUT,
272 272
 				'_raw_input_stream',
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 
291 291
 		// Create controller
292 292
 		$controller = new $class;
293
-		$CI =& get_instance();
293
+		$CI = & get_instance();
294 294
 
295 295
 		// Set CodeIgniter instance to TestCase
296 296
 		$this->testCase->setCI($CI);
@@ -330,8 +330,8 @@  discard block
 block discarded – undo
330 330
 	 */
331 331
 	public function getStatus()
332 332
 	{
333
-		$CI =& get_instance();
334
-		if (! isset($CI->output->_status))
333
+		$CI = & get_instance();
334
+		if ( ! isset($CI->output->_status))
335 335
 		{
336 336
 			throw new LogicException('Status code is not set. You must call $this->request() first');
337 337
 		}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestRouter.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,16 +29,14 @@
 block discarded – undo
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';
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
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,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		{
58 58
 			// If 404, CodeIgniter instance is not created yet. So create it here.
59 59
 			// Because we need $this->CI->output->_status
60
-			$CI =& get_instance();
60
+			$CI = & get_instance();
61 61
 			if ($CI === null)
62 62
 			{
63 63
 				new CI_Controller();
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestCase.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
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()
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	{
62 62
 		reset_instance();
63 63
 		new CI_Controller();
64
-		$this->CI =& get_instance();
64
+		$this->CI = & get_instance();
65 65
 	}
66 66
 
67 67
 	protected function tearDown()
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 		$this->assertSame(
237 237
 			$code,
238 238
 			$actual,
239
-			'Status code is not ' . $code . ' but ' . $actual . '.'
239
+			'Status code is not '.$code.' but '.$actual.'.'
240 240
 		);
241 241
 	}
242 242
 
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	 */
249 249
 	public function assertResponseHeader($name, $value)
250 250
 	{
251
-		$CI =& get_instance();
251
+		$CI = & get_instance();
252 252
 		$actual = $CI->output->get_header($name);
253 253
 
254 254
 		if ($actual === null)
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 	 */
273 273
 	public function assertResponseCookie($name, $value, $allow_duplicate = false)
274 274
 	{
275
-		$CI =& get_instance();
275
+		$CI = & get_instance();
276 276
 		$cookies = isset($CI->output->_cookies[$name])
277 277
 			? $CI->output->_cookies[$name] : null;
278 278
 
@@ -330,18 +330,18 @@  discard block
 block discarded – undo
330 330
 			$this->fail('redirect() is not called.');
331 331
 		}
332 332
 
333
-		if (! function_exists('site_url'))
333
+		if ( ! function_exists('site_url'))
334 334
 		{
335
-			$CI =& get_instance();
335
+			$CI = & get_instance();
336 336
 			$CI->load->helper('url');
337 337
 		}
338 338
 		$absolute_url = site_url($uri);
339
-		$expected = 'Redirect to ' . $absolute_url;
339
+		$expected = 'Redirect to '.$absolute_url;
340 340
 
341 341
 		$this->assertSame(
342 342
 			$expected,
343 343
 			$status['redirect'],
344
-			'URL to redirect is not ' . $expected . ' but ' . $status['redirect'] . '.'
344
+			'URL to redirect is not '.$expected.' but '.$status['redirect'].'.'
345 345
 		);
346 346
 
347 347
 		if ($code !== null)
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 			$this->assertSame(
350 350
 				$code,
351 351
 				$status['code'],
352
-				'Status code is not ' . $code . ' but ' . $status['code'] . '.'
352
+				'Status code is not '.$code.' but '.$status['code'].'.'
353 353
 			);
354 354
 		}
355 355
 	}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTest.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -31,29 +31,29 @@  discard block
 block discarded – undo
31 31
 		self::$autoload_dirs = $autoload_dirs;
32 32
 
33 33
 		// Load autoloader for ci-phpunit-test
34
-		require __DIR__ . '/autoloader.php';
34
+		require __DIR__.'/autoloader.php';
35 35
 
36 36
 		// Autoloader for PHP-Parser
37 37
 		// Don't use `require`, because we may have required already
38 38
 		// in `patcher/bootstrap.php`
39
-		require_once __DIR__ . '/patcher/third_party/PHP-Parser/lib/bootstrap.php';
39
+		require_once __DIR__.'/patcher/third_party/PHP-Parser/lib/bootstrap.php';
40 40
 
41
-		require APPPATH . '/tests/TestCase.php';
41
+		require APPPATH.'/tests/TestCase.php';
42 42
 
43 43
 		// Replace a few Common functions
44
-		require __DIR__ . '/replacing/core/Common.php';
45
-		require BASEPATH . 'core/Common.php';
44
+		require __DIR__.'/replacing/core/Common.php';
45
+		require BASEPATH.'core/Common.php';
46 46
 
47 47
 		// Workaround for missing CodeIgniter's error handler
48 48
 		// See https://github.com/kenjis/ci-phpunit-test/issues/37
49 49
 		set_error_handler('_error_handler');
50 50
 
51 51
 		// Load new functions of CIPHPUnitTest
52
-		require __DIR__ . '/functions.php';
52
+		require __DIR__.'/functions.php';
53 53
 		// Load ci-phpunit-test CI_Loader
54
-		require __DIR__ . '/replacing/core/Loader.php';
54
+		require __DIR__.'/replacing/core/Loader.php';
55 55
 		// Load ci-phpunit-test CI_Input
56
-		require __DIR__ . '/replacing/core/Input.php';
56
+		require __DIR__.'/replacing/core/Input.php';
57 57
 
58 58
 		// Change current directroy
59 59
 		chdir(FCPATH);
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
 		 *
66 66
 		 * And away we go...
67 67
 		 */
68
-		require __DIR__ . '/replacing/core/CodeIgniter.php';
68
+		require __DIR__.'/replacing/core/CodeIgniter.php';
69 69
 
70 70
 		self::replaceHelpers();
71 71
 
72 72
 		// Create CodeIgniter instance
73
-		if (! self::wiredesignzHmvcInstalled())
73
+		if ( ! self::wiredesignzHmvcInstalled())
74 74
 		{
75 75
 			new CI_Controller();
76 76
 		}
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
 	public static function createCodeIgniterInstance()
90 90
 	{
91
-		if (! self::wiredesignzHmvcInstalled())
91
+		if ( ! self::wiredesignzHmvcInstalled())
92 92
 		{
93 93
 			new CI_Controller();
94 94
 		}
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
 	protected static function replaceLoader()
118 118
 	{
119 119
 		$my_loader_file = 
120
-			APPPATH . 'core/' . config_item('subclass_prefix') . 'Loader.php';
120
+			APPPATH.'core/'.config_item('subclass_prefix').'Loader.php';
121 121
 
122 122
 		if (file_exists($my_loader_file))
123 123
 		{
124
-			self::$loader_class = config_item('subclass_prefix') . 'Loader';
124
+			self::$loader_class = config_item('subclass_prefix').'Loader';
125 125
 			if ( ! class_exists(self::$loader_class))
126 126
 			{
127 127
 				require $my_loader_file;
@@ -132,19 +132,19 @@  discard block
 block discarded – undo
132 132
 
133 133
 	protected static function replaceHelpers()
134 134
 	{
135
-		$my_helper_file = APPPATH . 'helpers/' . config_item('subclass_prefix') . 'url_helper.php';
135
+		$my_helper_file = APPPATH.'helpers/'.config_item('subclass_prefix').'url_helper.php';
136 136
 		if (file_exists($my_helper_file))
137 137
 		{
138 138
 			require $my_helper_file;
139 139
 		}
140
-		require __DIR__ . '/replacing/helpers/url_helper.php';
140
+		require __DIR__.'/replacing/helpers/url_helper.php';
141 141
 	}
142 142
 
143 143
 	public static function setPatcherCacheDir($dir = null)
144 144
 	{
145 145
 		if ($dir === null)
146 146
 		{
147
-			$dir = APPPATH . 'tests/_ci_phpunit_test/tmp/cache';
147
+			$dir = APPPATH.'tests/_ci_phpunit_test/tmp/cache';
148 148
 		}
149 149
 
150 150
 		MonkeyPatchManager::setCacheDir(
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,8 +47,7 @@  discard block
 block discarded – undo
47 47
 					? $backtrace[$offset+2]['class']
48 48
 					: null;
49 49
 			$function = $backtrace[$offset+2]['function'];
50
-		}
51
-		else
50
+		} else
52 51
 		{
53 52
 			$class = null;
54 53
 			$function = null;
@@ -59,8 +58,7 @@  discard block
 block discarded – undo
59 58
 			$method = $function;
60 59
 			$class_method = $class . '::' . $function;
61 60
 			$function = null;
62
-		}
63
-		else
61
+		} else
64 62
 		{
65 63
 			$method = null;
66 64
 			$class_method = null;
Please login to merge, or discard this patch.