Completed
Pull Request — master (#336)
by
unknown
02:35 queued 18s
created
application/tests/_ci_phpunit_test/TestSuiteProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 use PHPUnit_Util_Configuration;
44 44
 
45 45
 // Support PHPUnit 6.0
46
-if (! class_exists('PHPUnit_Util_Configuration')) {
46
+if ( ! class_exists('PHPUnit_Util_Configuration')) {
47 47
     class_alias('PHPUnit\Util\Configuration', 'PHPUnit_Util_Configuration');
48 48
 }
49 49
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      */
119 119
     private static function checkConfigurationFile($file)
120 120
     {
121
-        if (!file_exists($file)) {
121
+        if ( ! file_exists($file)) {
122 122
             throw new \RuntimeException("The requested phpunit configuration was not found at $file");
123 123
         }
124 124
 
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,12 +52,12 @@  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 59
 
60
-	$CFG =& load_class('Config', 'core');
60
+	$CFG = & load_class('Config', 'core');
61 61
 	CIPHPUnitTestSuperGlobal::set_Global('CFG', $CFG);
62 62
 	// Do we have any manually set config items in the index.php file?
63 63
 	global $assign_to_config;
@@ -69,19 +69,19 @@  discard block
 block discarded – undo
69 69
 		}
70 70
 	}
71 71
 
72
-	$UNI =& load_class('URI', 'core');
72
+	$UNI = & load_class('URI', 'core');
73 73
 	CIPHPUnitTestSuperGlobal::set_Global('UNI', $UNI);
74 74
 //	$URI =& load_class('Utf8', 'core');
75 75
 //	CIPHPUnitTestSuperGlobal::set_Global('URI', $URI);
76
-	$RTR =& load_class('Router', 'core');
76
+	$RTR = & load_class('Router', 'core');
77 77
 	CIPHPUnitTestSuperGlobal::set_Global('RTR', $RTR);
78
-	$OUT =& load_class('Output', 'core');
78
+	$OUT = & load_class('Output', 'core');
79 79
 	CIPHPUnitTestSuperGlobal::set_Global('OUT', $OUT);
80
-	$SEC =& load_class('Security', 'core');
80
+	$SEC = & load_class('Security', 'core');
81 81
 	CIPHPUnitTestSuperGlobal::set_Global('SEC', $SEC);
82
-	$IN =& load_class('Input', 'core');
82
+	$IN = & load_class('Input', 'core');
83 83
 	CIPHPUnitTestSuperGlobal::set_Global('IN', $IN);
84
-	$LANG =& load_class('Lang', 'core');
84
+	$LANG = & load_class('Lang', 'core');
85 85
 	CIPHPUnitTestSuperGlobal::set_Global('LANG', $LANG);
86 86
 
87 87
 	CIPHPUnitTest::loadLoader();
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_file(TESTPATH . '_ci_phpunit_test' . DIRECTORY_SEPARATOR . 'CIPHPUnitTest.php'))
317
+	if (is_file(TESTPATH.'_ci_phpunit_test'.DIRECTORY_SEPARATOR.'CIPHPUnitTest.php'))
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
 	{
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
  * -------------------------------------------------------------------
378 378
  */
379 379
 
380
-require CI_PHPUNIT_TESTPATH . '/CIPHPUnitTest.php';
380
+require CI_PHPUNIT_TESTPATH.'/CIPHPUnitTest.php';
381 381
 
382 382
 CIPHPUnitTest::init();
383 383
 // Or you can set directories for autoloading
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestDbTestCase.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	{
36 36
 		if ($this->db === null)
37 37
 		{
38
-			$CI =& get_instance();
38
+			$CI = & get_instance();
39 39
 			$CI->load->database();
40 40
 			$this->db = $CI->db;
41 41
 		}
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	{
57 57
 		$this->checkDbConnId();
58 58
 		
59
-		if (! empty($this->insertCache))
59
+		if ( ! empty($this->insertCache))
60 60
 		{
61 61
 			foreach ($this->insertCache as $row)
62 62
 			{
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 		$this->db->close();
84 84
 		$this->db = null;
85 85
 
86
-		$CI =& get_instance();
86
+		$CI = & get_instance();
87 87
 		$CI->load->database();
88 88
 		$this->db = $CI->db;
89 89
 	}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTest.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
 	 */
29 29
 	public static function init(array $autoload_dirs = null)
30 30
 	{
31
-		if (! defined('TESTPATH')) {
31
+		if ( ! defined('TESTPATH')) {
32 32
 			define('TESTPATH', APPPATH.'tests'.DIRECTORY_SEPARATOR);
33 33
 		}
34 34
 		// Current Bootstrap.php should define this, but in case it doesn't:
35
-		if (! defined('CI_PHPUNIT_TESTPATH')) {
35
+		if ( ! defined('CI_PHPUNIT_TESTPATH')) {
36 36
 			define('CI_PHPUNIT_TESTPATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
37 37
 		}
38 38
 
@@ -49,38 +49,38 @@  discard block
 block discarded – undo
49 49
 		$cwd_backup = getcwd();
50 50
 
51 51
 		// Load autoloader for ci-phpunit-test
52
-		require __DIR__ . '/autoloader.php';
52
+		require __DIR__.'/autoloader.php';
53 53
 
54
-		require TESTPATH . 'TestCase.php';
54
+		require TESTPATH.'TestCase.php';
55 55
 
56
-		$db_test_case_file = TESTPATH . 'DbTestCase.php';
56
+		$db_test_case_file = TESTPATH.'DbTestCase.php';
57 57
 		if (is_readable($db_test_case_file))
58 58
 		{
59 59
 			require $db_test_case_file;
60 60
 		}
61 61
 
62
-		$unit_test_case_file = TESTPATH . 'UnitTestCase.php';
62
+		$unit_test_case_file = TESTPATH.'UnitTestCase.php';
63 63
 		if (is_readable($unit_test_case_file))
64 64
 		{
65 65
 			require $unit_test_case_file;
66 66
 		}
67 67
 
68 68
 		// Replace a few Common functions
69
-		require __DIR__ . '/replacing/core/Common.php';
70
-		require BASEPATH . 'core/Common.php';
69
+		require __DIR__.'/replacing/core/Common.php';
70
+		require BASEPATH.'core/Common.php';
71 71
 
72 72
 		// Workaround for missing CodeIgniter's error handler
73 73
 		// See https://github.com/kenjis/ci-phpunit-test/issues/37
74 74
 		set_error_handler('_error_handler');
75 75
 
76 76
 		// Load new functions of CIPHPUnitTest
77
-		require __DIR__ . '/functions.php';
77
+		require __DIR__.'/functions.php';
78 78
 		// Load ci-phpunit-test CI_Loader
79
-		require __DIR__ . '/replacing/core/Loader.php';
79
+		require __DIR__.'/replacing/core/Loader.php';
80 80
 		// Load ci-phpunit-test CI_Input
81
-		require __DIR__ . '/replacing/core/Input.php';
81
+		require __DIR__.'/replacing/core/Input.php';
82 82
 		// Load ci-phpunit-test CI_Output
83
-		require __DIR__ . '/replacing/core/Output.php';
83
+		require __DIR__.'/replacing/core/Output.php';
84 84
 
85 85
 		// Change current directory
86 86
 		chdir(FCPATH);
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
 		 *
96 96
 		 * And away we go...
97 97
 		 */
98
-		require __DIR__ . '/replacing/core/CodeIgniter.php';
98
+		require __DIR__.'/replacing/core/CodeIgniter.php';
99 99
 
100 100
 		// Create CodeIgniter instance
101
-		if (! self::wiredesignzHmvcInstalled())
101
+		if ( ! self::wiredesignzHmvcInstalled())
102 102
 		{
103 103
 			new CI_Controller();
104 104
 		}
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	 */
124 124
 	public static function createCodeIgniterInstance($use_my_controller = false)
125 125
 	{
126
-		if (! self::wiredesignzHmvcInstalled())
126
+		if ( ! self::wiredesignzHmvcInstalled())
127 127
 		{
128 128
 			if ($use_my_controller && self::hasMyController())
129 129
 			{
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
 		}
149 149
 
150 150
 		$my_controller_file =
151
-			APPPATH . 'core/' . config_item('subclass_prefix') . 'Controller.php';
151
+			APPPATH.'core/'.config_item('subclass_prefix').'Controller.php';
152 152
 
153 153
 		if (file_exists($my_controller_file))
154 154
 		{
155
-			$controller_class = config_item('subclass_prefix') . 'Controller';
155
+			$controller_class = config_item('subclass_prefix').'Controller';
156 156
 			if ( ! class_exists($controller_class))
157 157
 			{
158 158
 				require $my_controller_file;
@@ -184,11 +184,11 @@  discard block
 block discarded – undo
184 184
 	protected static function replaceLoader()
185 185
 	{
186 186
 		$my_loader_file =
187
-			APPPATH . 'core/' . config_item('subclass_prefix') . 'Loader.php';
187
+			APPPATH.'core/'.config_item('subclass_prefix').'Loader.php';
188 188
 
189 189
 		if (file_exists($my_loader_file))
190 190
 		{
191
-			self::$loader_class = config_item('subclass_prefix') . 'Loader';
191
+			self::$loader_class = config_item('subclass_prefix').'Loader';
192 192
 			if ( ! class_exists(self::$loader_class))
193 193
 			{
194 194
 				require $my_loader_file;
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
 	protected static function replaceConfig()
201 201
 	{
202 202
 		$my_config_file =
203
-			APPPATH . 'core/' . config_item('subclass_prefix') . 'Config.php';
203
+			APPPATH.'core/'.config_item('subclass_prefix').'Config.php';
204 204
 
205 205
 		if (file_exists($my_config_file))
206 206
 		{
207
-			self::$config_class = config_item('subclass_prefix') . 'Config';
207
+			self::$config_class = config_item('subclass_prefix').'Config';
208 208
 			if ( ! class_exists(self::$config_class))
209 209
 			{
210 210
 				require $my_config_file;
@@ -223,19 +223,19 @@  discard block
 block discarded – undo
223 223
 
224 224
 	protected static function loadHelper($helper)
225 225
 	{
226
-		$my_helper_file = APPPATH . 'helpers/' . config_item('subclass_prefix') . $helper . '.php';
226
+		$my_helper_file = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php';
227 227
 		if (file_exists($my_helper_file))
228 228
 		{
229 229
 			require $my_helper_file;
230 230
 		}
231
-		require __DIR__ . '/replacing/helpers/' . $helper . '.php';
231
+		require __DIR__.'/replacing/helpers/'.$helper.'.php';
232 232
 	}
233 233
 
234 234
 	public static function setPatcherCacheDir($dir = null)
235 235
 	{
236 236
 		if ($dir === null)
237 237
 		{
238
-			$dir = CI_PHPUNIT_TESTPATH . 'tmp/cache';
238
+			$dir = CI_PHPUNIT_TESTPATH.'tmp/cache';
239 239
 		}
240 240
 
241 241
 		MonkeyPatchManager::setCacheDir(
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 
252 252
 	public static function loadConfig()
253 253
 	{
254
-		$config= new self::$config_class;
254
+		$config = new self::$config_class;
255 255
 		load_class_instance('Config', $config);
256 256
 	}
257 257
 }
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/replacing/core/Common.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	if ($_log === NULL)
202 202
 	{
203 203
 		// references cannot be directly assigned to static variables, so we use an array
204
-		$_log[0] =& load_class('Log', 'core');
204
+		$_log[0] = & load_class('Log', 'core');
205 205
 	}
206 206
 
207 207
 	$_log[0]->write_log($level, $message);
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 
292 292
 	// Save status code in Output object
293 293
 	// added by ci-phpunit-test
294
-	$CI =& get_instance();
294
+	$CI = & get_instance();
295 295
 	$output = $CI->output;
296 296
 	$output->_status = [
297 297
 		'code'     => $code,
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 	if (empty($_config))
406 406
 	{
407 407
 		// references cannot be directly assigned to static variables, so we use an array
408
-		$_config[0] =& get_config();
408
+		$_config[0] = & get_config();
409 409
 	}
410 410
 
411 411
 	return isset($_config[0][$item]) ? $_config[0][$item] : NULL;
Please login to merge, or discard this patch.