Completed
Pull Request — master (#165)
by Kenji
02:57
created
application/tests/_ci_phpunit_test/replacing/helpers/download_helper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 			}
102 102
 
103 103
 			// Load the mime types
104
-			$mimes =& get_mimes();
104
+			$mimes = & get_mimes();
105 105
 
106 106
 			// Only change the default MIME if we can find one
107 107
 			if (isset($mimes[$extension]))
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
 		if (ENVIRONMENT === 'testing')
148 148
 		{
149
-			$CI =& get_instance();
149
+			$CI = & get_instance();
150 150
 			$CI->output->set_header('Content-Type: '.$mime);
151 151
 			$CI->output->set_header('Content-Disposition: attachment; filename="'.$filename.'"');
152 152
 			$CI->output->set_header('Expires: 0');
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestCase.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 			return $this->$name;
50 50
 		}
51 51
 
52
-		throw new LogicException('No such property: ' . $name);
52
+		throw new LogicException('No such property: '.$name);
53 53
 	}
54 54
 
55 55
 	public static function setUpBeforeClass()
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	{
73 73
 		reset_instance();
74 74
 		CIPHPUnitTest::createCodeIgniterInstance();
75
-		$this->CI =& get_instance();
75
+		$this->CI = & get_instance();
76 76
 	}
77 77
 
78 78
 	/**
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	{
86 86
 		reset_instance();
87 87
 		$controller = new $classname;
88
-		$this->CI =& get_instance();
88
+		$this->CI = & get_instance();
89 89
 		return $controller;
90 90
 	}
91 91
 
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 		$this->assertSame(
267 267
 			$code,
268 268
 			$actual,
269
-			'Status code is not ' . $code . ' but ' . $actual . '.'
269
+			'Status code is not '.$code.' but '.$actual.'.'
270 270
 		);
271 271
 	}
272 272
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 	 */
279 279
 	public function assertResponseHeader($name, $value)
280 280
 	{
281
-		$CI =& get_instance();
281
+		$CI = & get_instance();
282 282
 		$actual = $CI->output->get_header($name);
283 283
 
284 284
 		if ($actual === null)
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 	 */
303 303
 	public function assertResponseCookie($name, $value, $allow_duplicate = false)
304 304
 	{
305
-		$CI =& get_instance();
305
+		$CI = & get_instance();
306 306
 		$cookies = isset($CI->output->_cookies[$name])
307 307
 			? $CI->output->_cookies[$name] : null;
308 308
 
@@ -360,23 +360,23 @@  discard block
 block discarded – undo
360 360
 			$this->fail('redirect() is not called.');
361 361
 		}
362 362
 
363
-		if (! function_exists('site_url'))
363
+		if ( ! function_exists('site_url'))
364 364
 		{
365
-			$CI =& get_instance();
365
+			$CI = & get_instance();
366 366
 			$CI->load->helper('url');
367 367
 		}
368 368
 
369
-		if (! preg_match('#^(\w+:)?//#i', $uri))
369
+		if ( ! preg_match('#^(\w+:)?//#i', $uri))
370 370
 		{
371 371
 			$uri = site_url($uri);
372 372
 		}
373 373
 		$absolute_url = $uri;
374
-		$expected = 'Redirect to ' . $absolute_url;
374
+		$expected = 'Redirect to '.$absolute_url;
375 375
 
376 376
 		$this->assertSame(
377 377
 			$expected,
378 378
 			$status['redirect'],
379
-			'URL to redirect is not ' . $expected . ' but ' . $status['redirect'] . '.'
379
+			'URL to redirect is not '.$expected.' but '.$status['redirect'].'.'
380 380
 		);
381 381
 
382 382
 		if ($code !== null)
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 			$this->assertSame(
385 385
 				$code,
386 386
 				$status['code'],
387
-				'Status code is not ' . $code . ' but ' . $status['code'] . '.'
387
+				'Status code is not '.$code.' but '.$status['code'].'.'
388 388
 			);
389 389
 		}
390 390
 	}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestSuperGlobal.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 		}
43 43
 
44 44
 		// Handle single file
45
-		$file =& $files[$field];
45
+		$file = & $files[$field];
46 46
 
47
-		if (! file_exists($file['tmp_name']))
47
+		if ( ! file_exists($file['tmp_name']))
48 48
 		{
49 49
 			$file['error'] = UPLOAD_ERR_NO_FILE;
50 50
 			$file['type'] = '';
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 				// Set $_GET if URI string has query string
111 111
 				parse_str($query_string, $_GET);
112 112
 				// Remove query string from URI string
113
-				$argv = substr($argv, 0, -strlen($query_string)-1);
113
+				$argv = substr($argv, 0, -strlen($query_string) - 1);
114 114
 			}
115 115
 		}
116 116
 
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
 		if ($_GET !== [])
144 144
 		{
145 145
 			$_SERVER['REQUEST_URI'] =
146
-				'/' . $path . '?'
146
+				'/'.$path.'?'
147 147
 				. http_build_query($_GET);
148 148
 		}
149 149
 		else
150 150
 		{
151
-			$_SERVER['REQUEST_URI'] = '/' . $path;
151
+			$_SERVER['REQUEST_URI'] = '/'.$path;
152 152
 		}
153 153
 	}
154 154
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 
166 166
 		if ($query_string === false)
167 167
 		{
168
-			throw new LogicException('Bad URI string: ' . $uri);
168
+			throw new LogicException('Bad URI string: '.$uri);
169 169
 		}
170 170
 
171 171
 		return $query_string;
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		}
191 191
 		else
192 192
 		{
193
-			$key = 'HTTP_' . $normalized_name;
193
+			$key = 'HTTP_'.$normalized_name;
194 194
 		}
195 195
 
196 196
 		$_SERVER[$key] = $value;
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/replacing/libraries/Upload.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -293,8 +293,8 @@  discard block
 block discarded – undo
293 293
 	{
294 294
 		empty($config) OR $this->initialize($config, FALSE);
295 295
 
296
-		$this->_mimes =& get_mimes();
297
-		$this->_CI =& get_instance();
296
+		$this->_mimes = & get_mimes();
297
+		$this->_CI = & get_instance();
298 298
 
299 299
 		log_message('info', 'Upload Class Initialized');
300 300
 	}
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 			else
481 481
 			{
482 482
 				// An extension was provided, let's have it!
483
-				$this->file_ext	= $this->get_extension($this->_file_name_override);
483
+				$this->file_ext = $this->get_extension($this->_file_name_override);
484 484
 			}
485 485
 
486 486
 			if ( ! $this->is_allowed_filetype(TRUE))
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 		// Convert the file size to kilobytes
494 494
 		if ($this->file_size > 0)
495 495
 		{
496
-			$this->file_size = round($this->file_size/1024, 2);
496
+			$this->file_size = round($this->file_size / 1024, 2);
497 497
 		}
498 498
 
499 499
 		// Is the file size within the allowed maximum?
@@ -818,10 +818,10 @@  discard block
 block discarded – undo
818 818
 			{
819 819
 				$types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png');
820 820
 
821
-				$this->image_width	= $D[0];
822
-				$this->image_height	= $D[1];
823
-				$this->image_type	= isset($types[$D[2]]) ? $types[$D[2]] : 'unknown';
824
-				$this->image_size_str	= $D[3]; // string containing height and width
821
+				$this->image_width = $D[0];
822
+				$this->image_height = $D[1];
823
+				$this->image_type = isset($types[$D[2]]) ? $types[$D[2]] : 'unknown';
824
+				$this->image_size_str = $D[3]; // string containing height and width
825 825
 			}
826 826
 		}
827 827
 
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
 			$this->file_type = 'image/jpeg';
870 870
 		}
871 871
 
872
-		$img_mimes = array('image/gif',	'image/jpeg', 'image/png');
872
+		$img_mimes = array('image/gif', 'image/jpeg', 'image/png');
873 873
 
874 874
 		return in_array($this->file_type, $img_mimes, TRUE);
875 875
 	}
@@ -1011,7 +1011,7 @@  discard block
 block discarded – undo
1011 1011
 			return FALSE;
1012 1012
 		}
1013 1013
 
1014
-		$this->upload_path = preg_replace('/(.+?)\/*$/', '\\1/',  $this->upload_path);
1014
+		$this->upload_path = preg_replace('/(.+?)\/*$/', '\\1/', $this->upload_path);
1015 1015
 		return TRUE;
1016 1016
 	}
1017 1017
 
@@ -1055,9 +1055,9 @@  discard block
 block discarded – undo
1055 1055
 		$ext = '';
1056 1056
 		if (strpos($filename, '.') !== FALSE)
1057 1057
 		{
1058
-			$parts		= explode('.', $filename);
1059
-			$ext		= '.'.array_pop($parts);
1060
-			$filename	= implode('.', $parts);
1058
+			$parts = explode('.', $filename);
1059
+			$ext = '.'.array_pop($parts);
1060
+			$filename = implode('.', $parts);
1061 1061
 		}
1062 1062
 
1063 1063
 		return substr($filename, 0, ($length - strlen($ext))).$ext;
Please login to merge, or discard this patch.
Installer.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
     public function install($app = 'application')
23 23
     {
24 24
         $this->recursiveCopy(
25
-            dirname(__FILE__) . '/application/tests',
26
-            $app . '/' . static::TEST_FOLDER
25
+            dirname(__FILE__).'/application/tests',
26
+            $app.'/'.static::TEST_FOLDER
27 27
         );
28 28
         $this->fixPath($app);
29 29
     }
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
      */
34 34
     private function fixPath($app = 'application')
35 35
     {
36
-        $file = $app . '/' . static::TEST_FOLDER . '/Bootstrap.php';
36
+        $file = $app.'/'.static::TEST_FOLDER.'/Bootstrap.php';
37 37
         $contents = file_get_contents($file);
38 38
         
39
-        if (! file_exists('system')) {
39
+        if ( ! file_exists('system')) {
40 40
             if (file_exists('vendor/codeigniter/framework/system')) {
41 41
                 $contents = str_replace(
42 42
                     '$system_path = \'../../system\';',
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             }
49 49
         }
50 50
         
51
-        if (! file_exists('index.php')) {
51
+        if ( ! file_exists('index.php')) {
52 52
             if (file_exists('public/index.php')) {
53 53
                 // CodeIgniter 3.0.6 and after
54 54
                 $contents = str_replace(
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
                     "define('FCPATH', realpath(dirname(__FILE__).'/../../public').'/');",
63 63
                     $contents
64 64
                 );
65
-            } elseif (file_exists($app . '/public/index.php')) {
65
+            } elseif (file_exists($app.'/public/index.php')) {
66 66
                 // CodeIgniter 3.0.6 and after
67 67
                 $contents = str_replace(
68 68
                     "define('FCPATH', realpath(dirname(__FILE__).'/../..').DIRECTORY_SEPARATOR);",
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
 
93 93
     public function update($app = 'application')
94 94
     {
95
-        $target_dir = $app . '/' . static::TEST_FOLDER . '/_ci_phpunit_test';
95
+        $target_dir = $app.'/'.static::TEST_FOLDER.'/_ci_phpunit_test';
96 96
         $this->recursiveUnlink($target_dir);
97 97
         $this->recursiveCopy(
98
-            dirname(__FILE__) . '/application/tests/_ci_phpunit_test',
98
+            dirname(__FILE__).'/application/tests/_ci_phpunit_test',
99 99
             $target_dir
100 100
         );
101 101
     }
@@ -117,12 +117,12 @@  discard block
 block discarded – undo
117 117
         
118 118
         foreach ($iterator as $file) {
119 119
             if ($file->isDir()) {
120
-                @mkdir($dst . '/' . $iterator->getSubPathName());
120
+                @mkdir($dst.'/'.$iterator->getSubPathName());
121 121
             } else {
122
-                $success = copy($file, $dst . '/' . $iterator->getSubPathName());
122
+                $success = copy($file, $dst.'/'.$iterator->getSubPathName());
123 123
                 if ($success) {
124
-                    if (! $this->silent) {
125
-                        echo 'copied: ' . $dst . '/' . $iterator->getSubPathName() . PHP_EOL;
124
+                    if ( ! $this->silent) {
125
+                        echo 'copied: '.$dst.'/'.$iterator->getSubPathName().PHP_EOL;
126 126
                     }
127 127
                 }
128 128
             }
Please login to merge, or discard this patch.
application/tests/Bootstrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
  * NOTE: If you change these, also change the error_reporting() code below
55 55
  */
56 56
 // This is needed for @runInSeparateProcess
57
-if (! defined('ENVIRONMENT'))
57
+if ( ! defined('ENVIRONMENT'))
58 58
 {
59 59
 	define('ENVIRONMENT', 'testing');
60 60
 }
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
  *  Added for ci-phpunit-test
358 358
  * -------------------------------------------------------------------
359 359
  */
360
-require __DIR__ . '/_ci_phpunit_test/CIPHPUnitTest.php';
360
+require __DIR__.'/_ci_phpunit_test/CIPHPUnitTest.php';
361 361
 CIPHPUnitTest::init();
362 362
 /*
363 363
  * Or you can set directories for autoloading
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/functions.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	reset_config();
33 33
 
34 34
 	// Close db connection
35
-	$CI =& get_instance();
35
+	$CI = & get_instance();
36 36
 	if (isset($CI->db))
37 37
 	{
38 38
 		if (
@@ -52,25 +52,25 @@  discard block
 block discarded – undo
52 52
 	}
53 53
 
54 54
 	// Load core classes
55
-	$BM =& load_class('Benchmark', 'core');
55
+	$BM = & load_class('Benchmark', 'core');
56 56
 	CIPHPUnitTestSuperGlobal::set_Global('BM', $BM);
57
-	$EXT =& load_class('Hooks', 'core');
57
+	$EXT = & load_class('Hooks', 'core');
58 58
 	CIPHPUnitTestSuperGlobal::set_Global('EXT', $EXT);
59
-	$CFG =& load_class('Config', 'core');
59
+	$CFG = & load_class('Config', 'core');
60 60
 	CIPHPUnitTestSuperGlobal::set_Global('CFG', $CFG);
61
-	$UNI =& load_class('URI', 'core');
61
+	$UNI = & load_class('URI', 'core');
62 62
 	CIPHPUnitTestSuperGlobal::set_Global('UNI', $UNI);
63 63
 //	$URI =& load_class('Utf8', 'core');
64 64
 //	CIPHPUnitTestSuperGlobal::set_Global('URI', $URI);
65
-	$RTR =& load_class('Router', 'core');
65
+	$RTR = & load_class('Router', 'core');
66 66
 	CIPHPUnitTestSuperGlobal::set_Global('RTR', $RTR);
67
-	$OUT =& load_class('Output', 'core');
67
+	$OUT = & load_class('Output', 'core');
68 68
 	CIPHPUnitTestSuperGlobal::set_Global('OUT', $OUT);
69
-	$SEC =& load_class('Security', 'core');
69
+	$SEC = & load_class('Security', 'core');
70 70
 	CIPHPUnitTestSuperGlobal::set_Global('SEC', $SEC);
71
-	$IN =& load_class('Input', 'core');
71
+	$IN = & load_class('Input', 'core');
72 72
 	CIPHPUnitTestSuperGlobal::set_Global('IN', $IN);
73
-	$LANG =& load_class('Lang', 'core');
73
+	$LANG = & load_class('Lang', 'core');
74 74
 	CIPHPUnitTestSuperGlobal::set_Global('LANG', $LANG);
75 75
 
76 76
 	CIPHPUnitTest::loadLoader();
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,7 +326,7 @@  discard block
 block discarded – undo
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);
@@ -372,8 +372,8 @@  discard block
 block discarded – undo
372 372
 	 */
373 373
 	public function getStatus()
374 374
 	{
375
-		$CI =& get_instance();
376
-		if (! isset($CI->output->_status))
375
+		$CI = & get_instance();
376
+		if ( ! isset($CI->output->_status))
377 377
 		{
378 378
 			throw new LogicException('Status code is not set. You must call $this->request() first');
379 379
 		}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestRouter.php 1 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 CI->output->_status
60
-			$CI =& get_instance();
60
+			$CI = & get_instance();
61 61
 			if ($CI instanceof CIPHPUnitTestNullCodeIgniter)
62 62
 			{
63 63
 				CIPHPUnitTest::createCodeIgniterInstance();
Please login to merge, or discard this patch.