Completed
Pull Request — master (#322)
by
unknown
02:51
created
application/tests/_ci_phpunit_test/patcher/4.x/Patcher/ExitPatcher.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 namespace Kenjis\MonkeyPatch\Patcher;
12 12
 
13
-require __DIR__ . '/../Exception/ExitException.php';
13
+require __DIR__.'/../Exception/ExitException.php';
14 14
 
15 15
 class ExitPatcher
16 16
 {
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 			}
31 31
 			elseif ($token[0] === T_EXIT)
32 32
 			{
33
-				if ($tokens[$i+1] === ';')
33
+				if ($tokens[$i + 1] === ';')
34 34
 				{
35 35
 					$new_source .= 'exit__()';
36 36
 				}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/patcher/bootstrap.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -12,36 +12,36 @@
 block discarded – undo
12 12
 if (class_exists('PhpParser\Autoloader')) {
13 13
 	if (class_exists('PhpParser\Node\Identifier')) {
14 14
 		// PHP-Parser 4.x
15
-		require __DIR__ . '/4.x/MonkeyPatchManager.php';
15
+		require __DIR__.'/4.x/MonkeyPatchManager.php';
16 16
 	}
17
-	elseif (method_exists('PhpParser\Node\Name','set')) {
17
+	elseif (method_exists('PhpParser\Node\Name', 'set')) {
18 18
 		// PHP-Parser 2.x
19
-		require __DIR__ . '/2.x/MonkeyPatchManager.php';
19
+		require __DIR__.'/2.x/MonkeyPatchManager.php';
20 20
 	} else {
21 21
 		// PHP-Parser 3.x
22
-		require __DIR__ . '/3.x/MonkeyPatchManager.php';
22
+		require __DIR__.'/3.x/MonkeyPatchManager.php';
23 23
 	}
24 24
 }
25 25
 // If you don't use Composer
26 26
 else {
27 27
 	if (version_compare(PHP_VERSION, '5.5.0', '>=')) {
28 28
 		// Use PHP-Parser 3.x
29
-		require __DIR__ . '/third_party/PHP-Parser-3.1.5/lib/bootstrap.php';
30
-		require __DIR__ . '/3.x/MonkeyPatchManager.php';
29
+		require __DIR__.'/third_party/PHP-Parser-3.1.5/lib/bootstrap.php';
30
+		require __DIR__.'/3.x/MonkeyPatchManager.php';
31 31
 	} else {
32 32
 		// Use PHP-Parser 2.x
33
-		require __DIR__ . '/third_party/PHP-Parser-2.1.1/lib/bootstrap.php';
34
-		require __DIR__ . '/2.x/MonkeyPatchManager.php';
33
+		require __DIR__.'/third_party/PHP-Parser-2.1.1/lib/bootstrap.php';
34
+		require __DIR__.'/2.x/MonkeyPatchManager.php';
35 35
 	}
36 36
 }
37 37
 
38
-require __DIR__ . '/IncludeStream.php';
39
-require __DIR__ . '/PathChecker.php';
40
-require __DIR__ . '/MonkeyPatch.php';
41
-require __DIR__ . '/Cache.php';
42
-require __DIR__ . '/InvocationVerifier.php';
38
+require __DIR__.'/IncludeStream.php';
39
+require __DIR__.'/PathChecker.php';
40
+require __DIR__.'/MonkeyPatch.php';
41
+require __DIR__.'/Cache.php';
42
+require __DIR__.'/InvocationVerifier.php';
43 43
 
44
-require __DIR__ . '/functions/exit__.php';
44
+require __DIR__.'/functions/exit__.php';
45 45
 
46 46
 const __GO_TO_ORIG__ = '__GO_TO_ORIG__';
47 47
 
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
 		}
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 */
55 55
 	protected function tearDown()
56 56
 	{
57
-		if (! empty($this->insertCache))
57
+		if ( ! empty($this->insertCache))
58 58
 		{
59 59
 			foreach ($this->insertCache as $row)
60 60
 			{
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 		$this->db->close();
82 82
 		$this->db = null;
83 83
 
84
-		$CI =& get_instance();
84
+		$CI = & get_instance();
85 85
 		$CI->load->database();
86 86
 		$this->db = $CI->db;
87 87
 	}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTest.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	public static function init(array $autoload_dirs = null)
29 29
 	{
30
-		if (! defined('TESTPATH')) {
30
+		if ( ! defined('TESTPATH')) {
31 31
 			define('TESTPATH', APPPATH.'tests'.DIRECTORY_SEPARATOR);
32 32
 		}
33 33
 		// Current Bootstrap.php should define this, but in case it doesn't:
34
-		if (! defined('CI_PHPUNIT_TESTPATH')) {
34
+		if ( ! defined('CI_PHPUNIT_TESTPATH')) {
35 35
 			define('CI_PHPUNIT_TESTPATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
36 36
 		}
37 37
 
@@ -48,38 +48,38 @@  discard block
 block discarded – undo
48 48
 		$cwd_backup = getcwd();
49 49
 
50 50
 		// Load autoloader for ci-phpunit-test
51
-		require __DIR__ . '/autoloader.php';
51
+		require __DIR__.'/autoloader.php';
52 52
 
53
-		require TESTPATH . 'TestCase.php';
53
+		require TESTPATH.'TestCase.php';
54 54
 
55
-		$db_test_case_file = TESTPATH . 'DbTestCase.php';
55
+		$db_test_case_file = TESTPATH.'DbTestCase.php';
56 56
 		if (is_readable($db_test_case_file))
57 57
 		{
58 58
 			require $db_test_case_file;
59 59
 		}
60 60
 
61
-		$unit_test_case_file = TESTPATH . 'UnitTestCase.php';
61
+		$unit_test_case_file = TESTPATH.'UnitTestCase.php';
62 62
 		if (is_readable($unit_test_case_file))
63 63
 		{
64 64
 			require $unit_test_case_file;
65 65
 		}
66 66
 
67 67
 		// Replace a few Common functions
68
-		require __DIR__ . '/replacing/core/Common.php';
69
-		require BASEPATH . 'core/Common.php';
68
+		require __DIR__.'/replacing/core/Common.php';
69
+		require BASEPATH.'core/Common.php';
70 70
 
71 71
 		// Workaround for missing CodeIgniter's error handler
72 72
 		// See https://github.com/kenjis/ci-phpunit-test/issues/37
73 73
 		set_error_handler('_error_handler');
74 74
 
75 75
 		// Load new functions of CIPHPUnitTest
76
-		require __DIR__ . '/functions.php';
76
+		require __DIR__.'/functions.php';
77 77
 		// Load ci-phpunit-test CI_Loader
78
-		require __DIR__ . '/replacing/core/Loader.php';
78
+		require __DIR__.'/replacing/core/Loader.php';
79 79
 		// Load ci-phpunit-test CI_Input
80
-		require __DIR__ . '/replacing/core/Input.php';
80
+		require __DIR__.'/replacing/core/Input.php';
81 81
 		// Load ci-phpunit-test CI_Output
82
-		require __DIR__ . '/replacing/core/Output.php';
82
+		require __DIR__.'/replacing/core/Output.php';
83 83
 
84 84
 		// Change current directory
85 85
 		chdir(FCPATH);
@@ -94,10 +94,10 @@  discard block
 block discarded – undo
94 94
 		 *
95 95
 		 * And away we go...
96 96
 		 */
97
-		require __DIR__ . '/replacing/core/CodeIgniter.php';
97
+		require __DIR__.'/replacing/core/CodeIgniter.php';
98 98
 
99 99
 		// Create CodeIgniter instance
100
-		if (! self::wiredesignzHmvcInstalled())
100
+		if ( ! self::wiredesignzHmvcInstalled())
101 101
 		{
102 102
 			new CI_Controller();
103 103
 		}
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public static function createCodeIgniterInstance($use_my_controller = false)
123 123
 	{
124
-		if (! self::wiredesignzHmvcInstalled())
124
+		if ( ! self::wiredesignzHmvcInstalled())
125 125
 		{
126 126
 			if ($use_my_controller && self::hasMyController())
127 127
 			{
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
 		}
147 147
 
148 148
 		$my_controller_file =
149
-			APPPATH . 'core/' . config_item('subclass_prefix') . 'Controller.php';
149
+			APPPATH.'core/'.config_item('subclass_prefix').'Controller.php';
150 150
 
151 151
 		if (file_exists($my_controller_file))
152 152
 		{
153
-			$controller_class = config_item('subclass_prefix') . 'Controller';
153
+			$controller_class = config_item('subclass_prefix').'Controller';
154 154
 			if ( ! class_exists($controller_class))
155 155
 			{
156 156
 				require $my_controller_file;
@@ -182,11 +182,11 @@  discard block
 block discarded – undo
182 182
 	protected static function replaceLoader()
183 183
 	{
184 184
 		$my_loader_file =
185
-			APPPATH . 'core/' . config_item('subclass_prefix') . 'Loader.php';
185
+			APPPATH.'core/'.config_item('subclass_prefix').'Loader.php';
186 186
 
187 187
 		if (file_exists($my_loader_file))
188 188
 		{
189
-			self::$loader_class = config_item('subclass_prefix') . 'Loader';
189
+			self::$loader_class = config_item('subclass_prefix').'Loader';
190 190
 			if ( ! class_exists(self::$loader_class))
191 191
 			{
192 192
 				require $my_loader_file;
@@ -205,19 +205,19 @@  discard block
 block discarded – undo
205 205
 
206 206
 	protected static function loadHelper($helper)
207 207
 	{
208
-		$my_helper_file = APPPATH . 'helpers/' . config_item('subclass_prefix') . $helper . '.php';
208
+		$my_helper_file = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php';
209 209
 		if (file_exists($my_helper_file))
210 210
 		{
211 211
 			require $my_helper_file;
212 212
 		}
213
-		require __DIR__ . '/replacing/helpers/' . $helper . '.php';
213
+		require __DIR__.'/replacing/helpers/'.$helper.'.php';
214 214
 	}
215 215
 
216 216
 	public static function setPatcherCacheDir($dir = null)
217 217
 	{
218 218
 		if ($dir === null)
219 219
 		{
220
-			$dir = CI_PHPUNIT_TESTPATH . 'tmp/cache';
220
+			$dir = CI_PHPUNIT_TESTPATH.'tmp/cache';
221 221
 		}
222 222
 
223 223
 		MonkeyPatchManager::setCacheDir(
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/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) && $CI->db instanceof 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.