Completed
Pull Request — master (#274)
by
unknown
02:33
created
application/tests/_ci_phpunit_test/replacing/core/old/3.1.8-CodeIgniter.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
  *  Start the timer... tick tock tick tock...
186 186
  * ------------------------------------------------------
187 187
  */
188
-	$BM =& load_class('Benchmark', 'core');
188
+	$BM = & load_class('Benchmark', 'core');
189 189
 	CIPHPUnitTestSuperGlobal::set_Global('BM', $BM);
190 190
 	$BM->mark('total_execution_time_start');
191 191
 	$BM->mark('loading_time:_base_classes_start');
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
  *  Instantiate the hooks class
196 196
  * ------------------------------------------------------
197 197
  */
198
-	$EXT =& load_class('Hooks', 'core');
198
+	$EXT = & load_class('Hooks', 'core');
199 199
 	CIPHPUnitTestSuperGlobal::set_Global('EXT', $EXT);
200 200
 
201 201
 /*
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
  * depending on another class that uses it.
216 216
  *
217 217
  */
218
-	$CFG =& load_class('Config', 'core');
218
+	$CFG = & load_class('Config', 'core');
219 219
 	CIPHPUnitTestSuperGlobal::set_Global('CFG', $CFG);
220 220
 
221 221
 	// Do we have any manually set config items in the index.php file?
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
  *  Instantiate the UTF-8 class
295 295
  * ------------------------------------------------------
296 296
  */
297
-	$UNI =& load_class('Utf8', 'core');
297
+	$UNI = & load_class('Utf8', 'core');
298 298
 	CIPHPUnitTestSuperGlobal::set_Global('UNI', $UNI);
299 299
 
300 300
 /*
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
  *  Instantiate the URI class
303 303
  * ------------------------------------------------------
304 304
  */
305
-	$URI =& load_class('URI', 'core');
305
+	$URI = & load_class('URI', 'core');
306 306
 	CIPHPUnitTestSuperGlobal::set_Global('URI', $URI);
307 307
 
308 308
 /*
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
  *  Instantiate the routing class and set the routing
311 311
  * ------------------------------------------------------
312 312
  */
313
-	$RTR =& load_class('Router', 'core', isset($routing) ? $routing : NULL);
313
+	$RTR = & load_class('Router', 'core', isset($routing) ? $routing : NULL);
314 314
 	CIPHPUnitTestSuperGlobal::set_Global('RTR', $RTR);
315 315
 
316 316
 /*
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
  *  Instantiate the output class
319 319
  * ------------------------------------------------------
320 320
  */
321
-	$OUT =& load_class('Output', 'core');
321
+	$OUT = & load_class('Output', 'core');
322 322
 	CIPHPUnitTestSuperGlobal::set_Global('OUT', $OUT);
323 323
 
324 324
 /*
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
  * Load the security class for xss and csrf support
337 337
  * -----------------------------------------------------
338 338
  */
339
-	$SEC =& load_class('Security', 'core');
339
+	$SEC = & load_class('Security', 'core');
340 340
 	CIPHPUnitTestSuperGlobal::set_Global('SEC', $SEC);
341 341
 
342 342
 /*
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
  *  Load the Input class and sanitize globals
345 345
  * ------------------------------------------------------
346 346
  */
347
-	$IN	=& load_class('Input', 'core');
347
+	$IN = & load_class('Input', 'core');
348 348
 	CIPHPUnitTestSuperGlobal::set_Global('IN', $IN);
349 349
 
350 350
 /*
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
  *  Load the Language class
353 353
  * ------------------------------------------------------
354 354
  */
355
-	$LANG =& load_class('Lang', 'core');
355
+	$LANG = & load_class('Lang', 'core');
356 356
 	CIPHPUnitTestSuperGlobal::set_Global('LANG', $LANG);
357 357
 
358 358
 /*
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 	 */
376 376
 	function &get_instance()
377 377
 	{
378
-		if (! CIPHPUnitTest::wiredesignzHmvcInstalled())
378
+		if ( ! CIPHPUnitTest::wiredesignzHmvcInstalled())
379 379
 		{
380 380
 			return CI_Controller::get_instance();
381 381
 		}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/replacing/libraries/old/3.1.8-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.
tests/_ci_phpunit_test/replacing/helpers/old/3.1.8-url_helper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
 				ob_end_clean();
106 106
 			}
107 107
 
108
-			throw new CIPHPUnitTestRedirectException('Redirect to ' . $uri, $code);
108
+			throw new CIPHPUnitTestRedirectException('Redirect to '.$uri, $code);
109 109
 		}
110 110
 	}
111 111
 }
Please login to merge, or discard this patch.
tests/_ci_phpunit_test/replacing/helpers/old/3.1.8-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/Bootstrap.php 1 patch
Spacing   +5 added lines, -5 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 `if` statemant is needed for @runInSeparateProcess
57
-if (! defined('ENVIRONMENT'))
57
+if ( ! defined('ENVIRONMENT'))
58 58
 {
59 59
 	define('ENVIRONMENT', 'testing');
60 60
 }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 	define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
233 233
 
234 234
 	// Path to the test directory containing all the test files.
235
-	define('TESTPATH', __dir__.DIRECTORY_SEPARATOR);  // Should be the folder this `Bootstrap.php` file is in.
235
+	define('TESTPATH', __dir__.DIRECTORY_SEPARATOR); // Should be the folder this `Bootstrap.php` file is in.
236 236
 
237 237
 	// Path to the system directory
238 238
 	define('BASEPATH', $system_path);
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
 	define('VIEWPATH', $view_folder.DIRECTORY_SEPARATOR);
315 315
 
316 316
 	// Path to the ci-phpunit-test directory
317
-	if (is_dir(TESTPATH . '_ci_phpunit_test'))
317
+	if (is_dir(TESTPATH.'_ci_phpunit_test'))
318 318
 	{
319
-		define('CI_PHPUNIT_TESTPATH', TESTPATH . '_ci_phpunit_test' . DIRECTORY_SEPARATOR);
319
+		define('CI_PHPUNIT_TESTPATH', TESTPATH.'_ci_phpunit_test'.DIRECTORY_SEPARATOR);
320 320
 	}
321 321
 	else
322 322
 	{
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 define('TESTPATH', APPPATH.'tests'.DIRECTORY_SEPARATOR);
380 380
 */
381 381
 
382
-require CI_PHPUNIT_TESTPATH . '/CIPHPUnitTest.php';
382
+require CI_PHPUNIT_TESTPATH.'/CIPHPUnitTest.php';
383 383
 
384 384
 CIPHPUnitTest::init();
385 385
 // Or you can set directories for autoloading
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTest.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
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
         // Current Bootstrap.php should define this, but in case it doesn't:
27
-		if (! defined('CI_PHPUNIT_TESTPATH')) {
27
+		if ( ! defined('CI_PHPUNIT_TESTPATH')) {
28 28
 			define('CI_PHPUNIT_TESTPATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
29 29
 		}
30 30
 
@@ -41,38 +41,38 @@  discard block
 block discarded – undo
41 41
 		$cwd_backup = getcwd();
42 42
 
43 43
 		// Load autoloader for ci-phpunit-test
44
-		require __DIR__ . '/autoloader.php';
44
+		require __DIR__.'/autoloader.php';
45 45
 
46
-		require TESTPATH . 'TestCase.php';
46
+		require TESTPATH.'TestCase.php';
47 47
 
48
-		$db_test_case_file = TESTPATH . 'DbTestCase.php';
48
+		$db_test_case_file = TESTPATH.'DbTestCase.php';
49 49
 		if (is_readable($db_test_case_file))
50 50
 		{
51 51
 			require $db_test_case_file;
52 52
 		}
53 53
 
54
-		$unit_test_case_file = TESTPATH . 'UnitTestCase.php';
54
+		$unit_test_case_file = TESTPATH.'UnitTestCase.php';
55 55
 		if (is_readable($unit_test_case_file))
56 56
 		{
57 57
 			require $unit_test_case_file;
58 58
 		}
59 59
 
60 60
 		// Replace a few Common functions
61
-		require __DIR__ . '/replacing/core/Common.php';
62
-		require BASEPATH . 'core/Common.php';
61
+		require __DIR__.'/replacing/core/Common.php';
62
+		require BASEPATH.'core/Common.php';
63 63
 
64 64
 		// Workaround for missing CodeIgniter's error handler
65 65
 		// See https://github.com/kenjis/ci-phpunit-test/issues/37
66 66
 		set_error_handler('_error_handler');
67 67
 
68 68
 		// Load new functions of CIPHPUnitTest
69
-		require __DIR__ . '/functions.php';
69
+		require __DIR__.'/functions.php';
70 70
 		// Load ci-phpunit-test CI_Loader
71
-		require __DIR__ . '/replacing/core/Loader.php';
71
+		require __DIR__.'/replacing/core/Loader.php';
72 72
 		// Load ci-phpunit-test CI_Input
73
-		require __DIR__ . '/replacing/core/Input.php';
73
+		require __DIR__.'/replacing/core/Input.php';
74 74
 		// Load ci-phpunit-test CI_Output
75
-		require __DIR__ . '/replacing/core/Output.php';
75
+		require __DIR__.'/replacing/core/Output.php';
76 76
 
77 77
 		// Change current directory
78 78
 		chdir(FCPATH);
@@ -84,12 +84,12 @@  discard block
 block discarded – undo
84 84
 		 *
85 85
 		 * And away we go...
86 86
 		 */
87
-		require __DIR__ . '/replacing/core/CodeIgniter.php';
87
+		require __DIR__.'/replacing/core/CodeIgniter.php';
88 88
 
89 89
 		self::replaceHelpers();
90 90
 
91 91
 		// Create CodeIgniter instance
92
-		if (! self::wiredesignzHmvcInstalled())
92
+		if ( ! self::wiredesignzHmvcInstalled())
93 93
 		{
94 94
 			new CI_Controller();
95 95
 		}
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 	public static function createCodeIgniterInstance()
112 112
 	{
113
-		if (! self::wiredesignzHmvcInstalled())
113
+		if ( ! self::wiredesignzHmvcInstalled())
114 114
 		{
115 115
 			new CI_Controller();
116 116
 		}
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
 	protected static function replaceLoader()
140 140
 	{
141 141
 		$my_loader_file =
142
-			APPPATH . 'core/' . config_item('subclass_prefix') . 'Loader.php';
142
+			APPPATH.'core/'.config_item('subclass_prefix').'Loader.php';
143 143
 
144 144
 		if (file_exists($my_loader_file))
145 145
 		{
146
-			self::$loader_class = config_item('subclass_prefix') . 'Loader';
146
+			self::$loader_class = config_item('subclass_prefix').'Loader';
147 147
 			if ( ! class_exists(self::$loader_class))
148 148
 			{
149 149
 				require $my_loader_file;
@@ -162,19 +162,19 @@  discard block
 block discarded – undo
162 162
 
163 163
 	protected static function loadHelper($helper)
164 164
 	{
165
-		$my_helper_file = APPPATH . 'helpers/' . config_item('subclass_prefix') . $helper . '.php';
165
+		$my_helper_file = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php';
166 166
 		if (file_exists($my_helper_file))
167 167
 		{
168 168
 			require $my_helper_file;
169 169
 		}
170
-		require __DIR__ . '/replacing/helpers/' . $helper . '.php';
170
+		require __DIR__.'/replacing/helpers/'.$helper.'.php';
171 171
 	}
172 172
 
173 173
 	public static function setPatcherCacheDir($dir = null)
174 174
 	{
175 175
 		if ($dir === null)
176 176
 		{
177
-			$dir = CI_PHPUNIT_TESTPATH . 'tmp/cache';
177
+			$dir = CI_PHPUNIT_TESTPATH.'tmp/cache';
178 178
 		}
179 179
 
180 180
 		MonkeyPatchManager::setCacheDir(
Please login to merge, or discard this patch.