Completed
Pull Request — master (#271)
by Kenji
02:40
created
application/tests/_ci_phpunit_test/CIPHPUnitTest.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public static function init(array $autoload_dirs = null)
23 23
 	{
24
-		if (! defined('TESTPATH')) {
24
+		if ( ! defined('TESTPATH')) {
25 25
 			define('TESTPATH', APPPATH.'tests'.DIRECTORY_SEPARATOR);
26 26
 		}
27 27
 
@@ -38,38 +38,38 @@  discard block
 block discarded – undo
38 38
 		$cwd_backup = getcwd();
39 39
 
40 40
 		// Load autoloader for ci-phpunit-test
41
-		require __DIR__ . '/autoloader.php';
41
+		require __DIR__.'/autoloader.php';
42 42
 
43
-		require TESTPATH . 'TestCase.php';
43
+		require TESTPATH.'TestCase.php';
44 44
 
45
-		$db_test_case_file = TESTPATH . 'DbTestCase.php';
45
+		$db_test_case_file = TESTPATH.'DbTestCase.php';
46 46
 		if (is_readable($db_test_case_file))
47 47
 		{
48 48
 			require $db_test_case_file;
49 49
 		}
50 50
 
51
-		$unit_test_case_file = TESTPATH . 'UnitTestCase.php';
51
+		$unit_test_case_file = TESTPATH.'UnitTestCase.php';
52 52
 		if (is_readable($unit_test_case_file))
53 53
 		{
54 54
 			require $unit_test_case_file;
55 55
 		}
56 56
 
57 57
 		// Replace a few Common functions
58
-		require __DIR__ . '/replacing/core/Common.php';
59
-		require BASEPATH . 'core/Common.php';
58
+		require __DIR__.'/replacing/core/Common.php';
59
+		require BASEPATH.'core/Common.php';
60 60
 
61 61
 		// Workaround for missing CodeIgniter's error handler
62 62
 		// See https://github.com/kenjis/ci-phpunit-test/issues/37
63 63
 		set_error_handler('_error_handler');
64 64
 
65 65
 		// Load new functions of CIPHPUnitTest
66
-		require __DIR__ . '/functions.php';
66
+		require __DIR__.'/functions.php';
67 67
 		// Load ci-phpunit-test CI_Loader
68
-		require __DIR__ . '/replacing/core/Loader.php';
68
+		require __DIR__.'/replacing/core/Loader.php';
69 69
 		// Load ci-phpunit-test CI_Input
70
-		require __DIR__ . '/replacing/core/Input.php';
70
+		require __DIR__.'/replacing/core/Input.php';
71 71
 		// Load ci-phpunit-test CI_Output
72
-		require __DIR__ . '/replacing/core/Output.php';
72
+		require __DIR__.'/replacing/core/Output.php';
73 73
 
74 74
 		// Change current directory
75 75
 		chdir(FCPATH);
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
 		 *
82 82
 		 * And away we go...
83 83
 		 */
84
-		require __DIR__ . '/replacing/core/CodeIgniter.php';
84
+		require __DIR__.'/replacing/core/CodeIgniter.php';
85 85
 
86 86
 		self::replaceHelpers();
87 87
 
88 88
 		// Create CodeIgniter instance
89
-		if (! self::wiredesignzHmvcInstalled())
89
+		if ( ! self::wiredesignzHmvcInstalled())
90 90
 		{
91 91
 			new CI_Controller();
92 92
 		}
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
 	public static function createCodeIgniterInstance()
109 109
 	{
110
-		if (! self::wiredesignzHmvcInstalled())
110
+		if ( ! self::wiredesignzHmvcInstalled())
111 111
 		{
112 112
 			if (self::hasMyController())
113 113
 			{
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
 		}
133 133
 
134 134
 		$my_controller_file =
135
-			APPPATH . 'core/' . config_item('subclass_prefix') . 'Controller.php';
135
+			APPPATH.'core/'.config_item('subclass_prefix').'Controller.php';
136 136
 
137 137
 		if (file_exists($my_controller_file))
138 138
 		{
139
-			$controller_class = config_item('subclass_prefix') . 'Controller';
139
+			$controller_class = config_item('subclass_prefix').'Controller';
140 140
 			if ( ! class_exists($controller_class))
141 141
 			{
142 142
 				require $my_controller_file;
@@ -168,11 +168,11 @@  discard block
 block discarded – undo
168 168
 	protected static function replaceLoader()
169 169
 	{
170 170
 		$my_loader_file =
171
-			APPPATH . 'core/' . config_item('subclass_prefix') . 'Loader.php';
171
+			APPPATH.'core/'.config_item('subclass_prefix').'Loader.php';
172 172
 
173 173
 		if (file_exists($my_loader_file))
174 174
 		{
175
-			self::$loader_class = config_item('subclass_prefix') . 'Loader';
175
+			self::$loader_class = config_item('subclass_prefix').'Loader';
176 176
 			if ( ! class_exists(self::$loader_class))
177 177
 			{
178 178
 				require $my_loader_file;
@@ -191,19 +191,19 @@  discard block
 block discarded – undo
191 191
 
192 192
 	protected static function loadHelper($helper)
193 193
 	{
194
-		$my_helper_file = APPPATH . 'helpers/' . config_item('subclass_prefix') . $helper . '.php';
194
+		$my_helper_file = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php';
195 195
 		if (file_exists($my_helper_file))
196 196
 		{
197 197
 			require $my_helper_file;
198 198
 		}
199
-		require __DIR__ . '/replacing/helpers/' . $helper . '.php';
199
+		require __DIR__.'/replacing/helpers/'.$helper.'.php';
200 200
 	}
201 201
 
202 202
 	public static function setPatcherCacheDir($dir = null)
203 203
 	{
204 204
 		if ($dir === null)
205 205
 		{
206
-			$dir = TESTPATH . '_ci_phpunit_test/tmp/cache';
206
+			$dir = TESTPATH.'_ci_phpunit_test/tmp/cache';
207 207
 		}
208 208
 
209 209
 		MonkeyPatchManager::setCacheDir(
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -89,8 +89,7 @@  discard block
 block discarded – undo
89 89
 		if (! self::wiredesignzHmvcInstalled())
90 90
 		{
91 91
 			new CI_Controller();
92
-		}
93
-		else
92
+		} else
94 93
 		{
95 94
 			new MX_Controller();
96 95
 		}
@@ -112,13 +111,11 @@  discard block
 block discarded – undo
112 111
 			if (self::hasMyController())
113 112
 			{
114 113
 				new self::$controller_class;
115
-			}
116
-			else
114
+			} else
117 115
 			{
118 116
 				new CI_Controller();
119 117
 			}
120
-		}
121
-		else
118
+		} else
122 119
 		{
123 120
 			new CI();
124 121
 			new MX_Controller();
Please login to merge, or discard this patch.