@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | array('in', 'err', 'createFile', '_stop'), |
48 | 48 | array($out, $out, $in) |
49 | 49 | ); |
50 | - $this->Task->path = TMP . 'tests' . DS; |
|
50 | + $this->Task->path = TMP.'tests'.DS; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | public function tearDown() { |
59 | 59 | parent::tearDown(); |
60 | 60 | |
61 | - $Folder = new Folder($this->Task->path . 'bake_test_app'); |
|
61 | + $Folder = new Folder($this->Task->path.'bake_test_app'); |
|
62 | 62 | $Folder->delete(); |
63 | 63 | unset($this->Task); |
64 | 64 | } |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | * @return void |
70 | 70 | */ |
71 | 71 | protected function _setupTestProject() { |
72 | - $skel = CAKE . 'Console' . DS . 'Templates' . DS . 'skel'; |
|
72 | + $skel = CAKE.'Console'.DS.'Templates'.DS.'skel'; |
|
73 | 73 | $this->Task->expects($this->at(0))->method('in')->will($this->returnValue('y')); |
74 | - $this->Task->bake($this->Task->path . 'bake_test_app', $skel); |
|
74 | + $this->Task->bake($this->Task->path.'bake_test_app', $skel); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -81,50 +81,50 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function testBake() { |
83 | 83 | $this->_setupTestProject(); |
84 | - $path = $this->Task->path . 'bake_test_app'; |
|
84 | + $path = $this->Task->path.'bake_test_app'; |
|
85 | 85 | |
86 | 86 | $this->assertTrue(is_dir($path), 'No project dir %s'); |
87 | 87 | $dirs = array( |
88 | 88 | 'Config', |
89 | - 'Config' . DS . 'Schema', |
|
89 | + 'Config'.DS.'Schema', |
|
90 | 90 | 'Console', |
91 | - 'Console' . DS . 'Command', |
|
92 | - 'Console' . DS . 'Templates', |
|
93 | - 'Console' . DS . 'Command' . DS . 'Task', |
|
91 | + 'Console'.DS.'Command', |
|
92 | + 'Console'.DS.'Templates', |
|
93 | + 'Console'.DS.'Command'.DS.'Task', |
|
94 | 94 | 'Controller', |
95 | - 'Controller' . DS . 'Component', |
|
95 | + 'Controller'.DS.'Component', |
|
96 | 96 | 'Locale', |
97 | 97 | 'Model', |
98 | - 'Model' . DS . 'Behavior', |
|
99 | - 'Model' . DS . 'Datasource', |
|
98 | + 'Model'.DS.'Behavior', |
|
99 | + 'Model'.DS.'Datasource', |
|
100 | 100 | 'Plugin', |
101 | 101 | 'Test', |
102 | - 'Test' . DS . 'Case', |
|
103 | - 'Test' . DS . 'Case' . DS . 'Controller', |
|
104 | - 'Test' . DS . 'Case' . DS . 'Controller' . DS . 'Component', |
|
105 | - 'Test' . DS . 'Case' . DS . 'Model', |
|
106 | - 'Test' . DS . 'Case' . DS . 'Model' . DS . 'Behavior', |
|
107 | - 'Test' . DS . 'Fixture', |
|
102 | + 'Test'.DS.'Case', |
|
103 | + 'Test'.DS.'Case'.DS.'Controller', |
|
104 | + 'Test'.DS.'Case'.DS.'Controller'.DS.'Component', |
|
105 | + 'Test'.DS.'Case'.DS.'Model', |
|
106 | + 'Test'.DS.'Case'.DS.'Model'.DS.'Behavior', |
|
107 | + 'Test'.DS.'Fixture', |
|
108 | 108 | 'Vendor', |
109 | 109 | 'View', |
110 | - 'View' . DS . 'Helper', |
|
110 | + 'View'.DS.'Helper', |
|
111 | 111 | 'tmp', |
112 | - 'tmp' . DS . 'cache', |
|
113 | - 'tmp' . DS . 'cache' . DS . 'models', |
|
114 | - 'tmp' . DS . 'cache' . DS . 'persistent', |
|
115 | - 'tmp' . DS . 'cache' . DS . 'views', |
|
116 | - 'tmp' . DS . 'logs', |
|
117 | - 'tmp' . DS . 'sessions', |
|
118 | - 'tmp' . DS . 'tests', |
|
112 | + 'tmp'.DS.'cache', |
|
113 | + 'tmp'.DS.'cache'.DS.'models', |
|
114 | + 'tmp'.DS.'cache'.DS.'persistent', |
|
115 | + 'tmp'.DS.'cache'.DS.'views', |
|
116 | + 'tmp'.DS.'logs', |
|
117 | + 'tmp'.DS.'sessions', |
|
118 | + 'tmp'.DS.'tests', |
|
119 | 119 | 'webroot', |
120 | - 'webroot' . DS . 'css', |
|
121 | - 'webroot' . DS . 'files', |
|
122 | - 'webroot' . DS . 'img', |
|
123 | - 'webroot' . DS . 'js', |
|
120 | + 'webroot'.DS.'css', |
|
121 | + 'webroot'.DS.'files', |
|
122 | + 'webroot'.DS.'img', |
|
123 | + 'webroot'.DS.'js', |
|
124 | 124 | |
125 | 125 | ); |
126 | 126 | foreach ($dirs as $dir) { |
127 | - $this->assertTrue(is_dir($path . DS . $dir), 'Missing ' . $dir); |
|
127 | + $this->assertTrue(is_dir($path.DS.$dir), 'Missing '.$dir); |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
@@ -134,16 +134,16 @@ discard block |
||
134 | 134 | * @return void |
135 | 135 | */ |
136 | 136 | public function testExecuteWithAbsolutePath() { |
137 | - $path = $this->Task->args[0] = TMP . 'tests' . DS . 'bake_test_app'; |
|
138 | - $this->Task->params['skel'] = CAKE . 'Console' . DS . 'Templates' . DS . 'skel'; |
|
137 | + $path = $this->Task->args[0] = TMP.'tests'.DS.'bake_test_app'; |
|
138 | + $this->Task->params['skel'] = CAKE.'Console'.DS.'Templates'.DS.'skel'; |
|
139 | 139 | $this->Task->expects($this->at(0))->method('in')->will($this->returnValue('y')); |
140 | 140 | $this->Task->execute(); |
141 | 141 | |
142 | 142 | $this->assertTrue(is_dir($this->Task->args[0]), 'No project dir'); |
143 | - $File = new File($path . DS . 'webroot' . DS . 'index.php'); |
|
143 | + $File = new File($path.DS.'webroot'.DS.'index.php'); |
|
144 | 144 | $contents = $File->read(); |
145 | 145 | $this->assertRegExp('/define\(\'CAKE_CORE_INCLUDE_PATH\', .*?DS/', $contents); |
146 | - $File = new File($path . DS . 'webroot' . DS . 'test.php'); |
|
146 | + $File = new File($path.DS.'webroot'.DS.'test.php'); |
|
147 | 147 | $contents = $File->read(); |
148 | 148 | $this->assertRegExp('/define\(\'CAKE_CORE_INCLUDE_PATH\', .*?DS/', $contents); |
149 | 149 | } |
@@ -154,22 +154,22 @@ discard block |
||
154 | 154 | * @return void |
155 | 155 | */ |
156 | 156 | public function testExecuteWithCakeOnIncludePath() { |
157 | - if (!function_exists('ini_set')) { |
|
157 | + if ( ! function_exists('ini_set')) { |
|
158 | 158 | $this->markTestAsSkipped('Not access to ini_set, cannot proceed.'); |
159 | 159 | } |
160 | 160 | $restore = ini_get('include_path'); |
161 | - ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . $restore); |
|
161 | + ini_set('include_path', CAKE_CORE_INCLUDE_PATH.PATH_SEPARATOR.$restore); |
|
162 | 162 | |
163 | - $path = $this->Task->args[0] = TMP . 'tests' . DS . 'bake_test_app'; |
|
164 | - $this->Task->params['skel'] = CAKE . 'Console' . DS . 'Templates' . DS . 'skel'; |
|
163 | + $path = $this->Task->args[0] = TMP.'tests'.DS.'bake_test_app'; |
|
164 | + $this->Task->params['skel'] = CAKE.'Console'.DS.'Templates'.DS.'skel'; |
|
165 | 165 | $this->Task->expects($this->at(0))->method('in')->will($this->returnValue('y')); |
166 | 166 | $this->Task->execute(); |
167 | 167 | |
168 | 168 | $this->assertTrue(is_dir($this->Task->args[0]), 'No project dir'); |
169 | - $contents = file_get_contents($path . DS . 'webroot' . DS . 'index.php'); |
|
169 | + $contents = file_get_contents($path.DS.'webroot'.DS.'index.php'); |
|
170 | 170 | $this->assertRegExp('#//define\(\'CAKE_CORE_INCLUDE_PATH#', $contents); |
171 | 171 | |
172 | - $contents = file_get_contents($path . DS . 'webroot' . DS . 'test.php'); |
|
172 | + $contents = file_get_contents($path.DS.'webroot'.DS.'test.php'); |
|
173 | 173 | $this->assertRegExp('#//define\(\'CAKE_CORE_INCLUDE_PATH#', $contents); |
174 | 174 | |
175 | 175 | ini_set('include_path', $restore); |
@@ -183,34 +183,34 @@ discard block |
||
183 | 183 | public function testBakeEmptyFlag() { |
184 | 184 | $this->Task->params['empty'] = true; |
185 | 185 | $this->_setupTestProject(); |
186 | - $path = $this->Task->path . 'bake_test_app'; |
|
186 | + $path = $this->Task->path.'bake_test_app'; |
|
187 | 187 | |
188 | 188 | $empty = array( |
189 | - 'Console' . DS . 'Command' . DS . 'Task' => 'empty', |
|
190 | - 'Controller' . DS . 'Component' => 'empty', |
|
189 | + 'Console'.DS.'Command'.DS.'Task' => 'empty', |
|
190 | + 'Controller'.DS.'Component' => 'empty', |
|
191 | 191 | 'Lib' => 'empty', |
192 | - 'Model' . DS . 'Behavior' => 'empty', |
|
193 | - 'Model' . DS . 'Datasource' => 'empty', |
|
192 | + 'Model'.DS.'Behavior' => 'empty', |
|
193 | + 'Model'.DS.'Datasource' => 'empty', |
|
194 | 194 | 'Plugin' => 'empty', |
195 | - 'Test' . DS . 'Case' . DS . 'Model' . DS . 'Behavior' => 'empty', |
|
196 | - 'Test' . DS . 'Case' . DS . 'Controller' . DS . 'Component' => 'empty', |
|
197 | - 'Test' . DS . 'Case' . DS . 'View' . DS . 'Helper' => 'empty', |
|
198 | - 'Test' . DS . 'Fixture' => 'empty', |
|
195 | + 'Test'.DS.'Case'.DS.'Model'.DS.'Behavior' => 'empty', |
|
196 | + 'Test'.DS.'Case'.DS.'Controller'.DS.'Component' => 'empty', |
|
197 | + 'Test'.DS.'Case'.DS.'View'.DS.'Helper' => 'empty', |
|
198 | + 'Test'.DS.'Fixture' => 'empty', |
|
199 | 199 | 'Vendor' => 'empty', |
200 | - 'View' . DS . 'Elements' => 'empty', |
|
201 | - 'View' . DS . 'Scaffolds' => 'empty', |
|
202 | - 'tmp' . DS . 'cache' . DS . 'models' => 'empty', |
|
203 | - 'tmp' . DS . 'cache' . DS . 'persistent' => 'empty', |
|
204 | - 'tmp' . DS . 'cache' . DS . 'views' => 'empty', |
|
205 | - 'tmp' . DS . 'logs' => 'empty', |
|
206 | - 'tmp' . DS . 'sessions' => 'empty', |
|
207 | - 'tmp' . DS . 'tests' => 'empty', |
|
208 | - 'webroot' . DS . 'js' => 'empty', |
|
209 | - 'webroot' . DS . 'files' => 'empty' |
|
200 | + 'View'.DS.'Elements' => 'empty', |
|
201 | + 'View'.DS.'Scaffolds' => 'empty', |
|
202 | + 'tmp'.DS.'cache'.DS.'models' => 'empty', |
|
203 | + 'tmp'.DS.'cache'.DS.'persistent' => 'empty', |
|
204 | + 'tmp'.DS.'cache'.DS.'views' => 'empty', |
|
205 | + 'tmp'.DS.'logs' => 'empty', |
|
206 | + 'tmp'.DS.'sessions' => 'empty', |
|
207 | + 'tmp'.DS.'tests' => 'empty', |
|
208 | + 'webroot'.DS.'js' => 'empty', |
|
209 | + 'webroot'.DS.'files' => 'empty' |
|
210 | 210 | ); |
211 | 211 | |
212 | 212 | foreach ($empty as $dir => $file) { |
213 | - $this->assertTrue(is_file($path . DS . $dir . DS . $file), sprintf('Missing %s file in %s', $file, $dir)); |
|
213 | + $this->assertTrue(is_file($path.DS.$dir.DS.$file), sprintf('Missing %s file in %s', $file, $dir)); |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 | |
@@ -222,11 +222,11 @@ discard block |
||
222 | 222 | public function testSecuritySaltGeneration() { |
223 | 223 | $this->_setupTestProject(); |
224 | 224 | |
225 | - $path = $this->Task->path . 'bake_test_app' . DS; |
|
225 | + $path = $this->Task->path.'bake_test_app'.DS; |
|
226 | 226 | $result = $this->Task->securitySalt($path); |
227 | 227 | $this->assertTrue($result); |
228 | 228 | |
229 | - $File = new File($path . 'Config' . DS . 'core.php'); |
|
229 | + $File = new File($path.'Config'.DS.'core.php'); |
|
230 | 230 | $contents = $File->read(); |
231 | 231 | $this->assertNotRegExp('/DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi/', $contents, 'Default Salt left behind. %s'); |
232 | 232 | } |
@@ -239,11 +239,11 @@ discard block |
||
239 | 239 | public function testSecurityCipherSeedGeneration() { |
240 | 240 | $this->_setupTestProject(); |
241 | 241 | |
242 | - $path = $this->Task->path . 'bake_test_app' . DS; |
|
242 | + $path = $this->Task->path.'bake_test_app'.DS; |
|
243 | 243 | $result = $this->Task->securityCipherSeed($path); |
244 | 244 | $this->assertTrue($result); |
245 | 245 | |
246 | - $File = new File($path . 'Config' . DS . 'core.php'); |
|
246 | + $File = new File($path.'Config'.DS.'core.php'); |
|
247 | 247 | $contents = $File->read(); |
248 | 248 | $this->assertNotRegExp('/76859309657453542496749683645/', $contents, 'Default CipherSeed left behind. %s'); |
249 | 249 | } |
@@ -256,11 +256,11 @@ discard block |
||
256 | 256 | public function testCachePrefixGeneration() { |
257 | 257 | $this->_setupTestProject(); |
258 | 258 | |
259 | - $path = $this->Task->path . 'bake_test_app' . DS; |
|
259 | + $path = $this->Task->path.'bake_test_app'.DS; |
|
260 | 260 | $result = $this->Task->cachePrefix($path); |
261 | 261 | $this->assertTrue($result); |
262 | 262 | |
263 | - $File = new File($path . 'Config' . DS . 'core.php'); |
|
263 | + $File = new File($path.'Config'.DS.'core.php'); |
|
264 | 264 | $contents = $File->read(); |
265 | 265 | $this->assertRegExp('/\$prefix = \'.+\';/', $contents, '$prefix is not defined'); |
266 | 266 | $this->assertNotRegExp('/\$prefix = \'myapp_\';/', $contents, 'Default cache prefix left behind. %s'); |
@@ -274,13 +274,13 @@ discard block |
||
274 | 274 | public function testIndexPhpGeneration() { |
275 | 275 | $this->_setupTestProject(); |
276 | 276 | |
277 | - $path = $this->Task->path . 'bake_test_app' . DS; |
|
277 | + $path = $this->Task->path.'bake_test_app'.DS; |
|
278 | 278 | $this->Task->corePath($path); |
279 | 279 | |
280 | - $File = new File($path . 'webroot' . DS . 'index.php'); |
|
280 | + $File = new File($path.'webroot'.DS.'index.php'); |
|
281 | 281 | $contents = $File->read(); |
282 | 282 | $this->assertNotRegExp('/define\(\'CAKE_CORE_INCLUDE_PATH\', ROOT/', $contents); |
283 | - $File = new File($path . 'webroot' . DS . 'test.php'); |
|
283 | + $File = new File($path.'webroot'.DS.'test.php'); |
|
284 | 284 | $contents = $File->read(); |
285 | 285 | $this->assertNotRegExp('/define\(\'CAKE_CORE_INCLUDE_PATH\', ROOT/', $contents); |
286 | 286 | } |
@@ -297,13 +297,13 @@ discard block |
||
297 | 297 | |
298 | 298 | Configure::write('Routing.prefixes', null); |
299 | 299 | $this->_setupTestProject(); |
300 | - $this->Task->configPath = $this->Task->path . 'bake_test_app' . DS . 'Config' . DS; |
|
300 | + $this->Task->configPath = $this->Task->path.'bake_test_app'.DS.'Config'.DS; |
|
301 | 301 | $this->Task->expects($this->once())->method('in')->will($this->returnValue('super_duper_admin')); |
302 | 302 | |
303 | 303 | $result = $this->Task->getPrefix(); |
304 | 304 | $this->assertEquals('super_duper_admin_', $result); |
305 | 305 | |
306 | - $File = new File($this->Task->configPath . 'core.php'); |
|
306 | + $File = new File($this->Task->configPath.'core.php'); |
|
307 | 307 | $File->delete(); |
308 | 308 | } |
309 | 309 | |
@@ -313,13 +313,13 @@ discard block |
||
313 | 313 | * @return void |
314 | 314 | */ |
315 | 315 | public function testCakeAdmin() { |
316 | - $File = new File(APP . 'Config' . DS . 'core.php'); |
|
316 | + $File = new File(APP.'Config'.DS.'core.php'); |
|
317 | 317 | $contents = $File->read(); |
318 | - $File = new File(TMP . 'tests' . DS . 'core.php'); |
|
318 | + $File = new File(TMP.'tests'.DS.'core.php'); |
|
319 | 319 | $File->write($contents); |
320 | 320 | |
321 | 321 | Configure::write('Routing.prefixes', null); |
322 | - $this->Task->configPath = TMP . 'tests' . DS; |
|
322 | + $this->Task->configPath = TMP.'tests'.DS; |
|
323 | 323 | $result = $this->Task->cakeAdmin('my_prefix'); |
324 | 324 | $this->assertTrue($result); |
325 | 325 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | public function testGetPrefixWithMultiplePrefixes() { |
336 | 336 | Configure::write('Routing.prefixes', array('admin', 'ninja', 'shinobi')); |
337 | 337 | $this->_setupTestProject(); |
338 | - $this->Task->configPath = $this->Task->path . 'bake_test_app' . DS . 'Config' . DS; |
|
338 | + $this->Task->configPath = $this->Task->path.'bake_test_app'.DS.'Config'.DS; |
|
339 | 339 | $this->Task->expects($this->once())->method('in')->will($this->returnValue(2)); |
340 | 340 | |
341 | 341 | $result = $this->Task->getPrefix(); |
@@ -348,23 +348,23 @@ discard block |
||
348 | 348 | * @return void |
349 | 349 | */ |
350 | 350 | public function testExecute() { |
351 | - $this->Task->params['skel'] = CAKE . 'Console' . DS . 'Templates' . DS . 'skel'; |
|
352 | - $this->Task->params['working'] = TMP . 'tests' . DS; |
|
351 | + $this->Task->params['skel'] = CAKE.'Console'.DS.'Templates'.DS.'skel'; |
|
352 | + $this->Task->params['working'] = TMP.'tests'.DS; |
|
353 | 353 | |
354 | - $path = $this->Task->path . 'bake_test_app'; |
|
354 | + $path = $this->Task->path.'bake_test_app'; |
|
355 | 355 | $this->Task->expects($this->at(0))->method('in')->will($this->returnValue($path)); |
356 | 356 | $this->Task->expects($this->at(1))->method('in')->will($this->returnValue('y')); |
357 | 357 | |
358 | 358 | $this->Task->execute(); |
359 | 359 | $this->assertTrue(is_dir($path), 'No project dir'); |
360 | - $this->assertTrue(is_dir($path . DS . 'Controller'), 'No controllers dir '); |
|
361 | - $this->assertTrue(is_dir($path . DS . 'Controller' . DS . 'Component'), 'No components dir '); |
|
362 | - $this->assertTrue(is_dir($path . DS . 'Model'), 'No models dir'); |
|
363 | - $this->assertTrue(is_dir($path . DS . 'View'), 'No views dir'); |
|
364 | - $this->assertTrue(is_dir($path . DS . 'View' . DS . 'Helper'), 'No helpers dir'); |
|
365 | - $this->assertTrue(is_dir($path . DS . 'Test'), 'No tests dir'); |
|
366 | - $this->assertTrue(is_dir($path . DS . 'Test' . DS . 'Case'), 'No cases dir'); |
|
367 | - $this->assertTrue(is_dir($path . DS . 'Test' . DS . 'Fixture'), 'No fixtures dir'); |
|
360 | + $this->assertTrue(is_dir($path.DS.'Controller'), 'No controllers dir '); |
|
361 | + $this->assertTrue(is_dir($path.DS.'Controller'.DS.'Component'), 'No components dir '); |
|
362 | + $this->assertTrue(is_dir($path.DS.'Model'), 'No models dir'); |
|
363 | + $this->assertTrue(is_dir($path.DS.'View'), 'No views dir'); |
|
364 | + $this->assertTrue(is_dir($path.DS.'View'.DS.'Helper'), 'No helpers dir'); |
|
365 | + $this->assertTrue(is_dir($path.DS.'Test'), 'No tests dir'); |
|
366 | + $this->assertTrue(is_dir($path.DS.'Test'.DS.'Case'), 'No cases dir'); |
|
367 | + $this->assertTrue(is_dir($path.DS.'Test'.DS.'Fixture'), 'No fixtures dir'); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
@@ -375,11 +375,11 @@ discard block |
||
375 | 375 | public function testConsolePath() { |
376 | 376 | $this->_setupTestProject(); |
377 | 377 | |
378 | - $path = $this->Task->path . 'bake_test_app' . DS; |
|
378 | + $path = $this->Task->path.'bake_test_app'.DS; |
|
379 | 379 | $result = $this->Task->consolePath($path); |
380 | 380 | $this->assertTrue($result); |
381 | 381 | |
382 | - $File = new File($path . 'Console' . DS . 'cake.php'); |
|
382 | + $File = new File($path.'Console'.DS.'cake.php'); |
|
383 | 383 | $contents = $File->read(); |
384 | 384 | $this->assertNotRegExp('/__CAKE_PATH__/', $contents, 'Console path placeholder left behind.'); |
385 | 385 | } |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | * @return void |
87 | 87 | */ |
88 | 88 | public function testFindingInstalledThemesForBake() { |
89 | - $consoleLibs = CAKE . 'Console' . DS; |
|
89 | + $consoleLibs = CAKE.'Console'.DS; |
|
90 | 90 | $this->Task->initialize(); |
91 | - $this->assertEquals($this->Task->templatePaths['default'], $consoleLibs . 'Templates' . DS . 'default' . DS); |
|
91 | + $this->assertEquals($this->Task->templatePaths['default'], $consoleLibs.'Templates'.DS.'default'.DS); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @return void |
99 | 99 | */ |
100 | 100 | public function testGetThemePath() { |
101 | - $defaultTheme = CAKE . 'Console' . DS . 'Templates' . DS . 'default' . DS; |
|
101 | + $defaultTheme = CAKE.'Console'.DS.'Templates'.DS.'default'.DS; |
|
102 | 102 | $this->Task->templatePaths = array('default' => $defaultTheme); |
103 | 103 | |
104 | 104 | $this->Task->expects($this->exactly(1))->method('in')->will($this->returnValue('1')); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | public function testGenerate() { |
126 | 126 | App::build(array( |
127 | 127 | 'Console' => array( |
128 | - CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS |
|
128 | + CAKE.'Test'.DS.'test_app'.DS.'Console'.DS |
|
129 | 129 | ) |
130 | 130 | )); |
131 | 131 | $this->Task->initialize(); |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | public function testGenerateWithTemplateFallbacks() { |
146 | 146 | App::build(array( |
147 | 147 | 'Console' => array( |
148 | - CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS, |
|
149 | - CAKE_CORE_INCLUDE_PATH . DS . 'console' . DS |
|
148 | + CAKE.'Test'.DS.'test_app'.DS.'Console'.DS, |
|
149 | + CAKE_CORE_INCLUDE_PATH.DS.'console'.DS |
|
150 | 150 | ) |
151 | 151 | )); |
152 | 152 | $this->Task->initialize(); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $this->Task->expects($this->never())->method('err'); |
225 | 225 | $this->Task->expects($this->never())->method('_stop'); |
226 | 226 | |
227 | - $file = TESTS . 'Case' . DS . 'Model' . DS . 'MyClassTest.php'; |
|
227 | + $file = TESTS.'Case'.DS.'Model'.DS.'MyClassTest.php'; |
|
228 | 228 | |
229 | 229 | $this->Task->expects($this->at(1))->method('createFile') |
230 | 230 | ->with($file, $this->anything()); |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $this->Task->expects($this->at(3))->method('createFile') |
233 | 233 | ->with($file, $this->anything()); |
234 | 234 | |
235 | - $file = TESTS . 'Case' . DS . 'Controller' . DS . 'CommentsControllerTest.php'; |
|
235 | + $file = TESTS.'Case'.DS.'Controller'.DS.'CommentsControllerTest.php'; |
|
236 | 236 | $this->Task->expects($this->at(5))->method('createFile') |
237 | 237 | ->with($file, $this->anything()); |
238 | 238 | |
@@ -584,8 +584,8 @@ discard block |
||
584 | 584 | $this->Task->plugin = 'TestTest'; |
585 | 585 | |
586 | 586 | //fake plugin path |
587 | - CakePlugin::load('TestTest', array('path' => APP . 'Plugin' . DS . 'TestTest' . DS)); |
|
588 | - $path = APP . 'Plugin' . DS . 'TestTest' . DS . 'Test' . DS . 'Case' . DS . 'View' . DS . 'Helper' . DS . 'FormHelperTest.php'; |
|
587 | + CakePlugin::load('TestTest', array('path' => APP.'Plugin'.DS.'TestTest'.DS)); |
|
588 | + $path = APP.'Plugin'.DS.'TestTest'.DS.'Test'.DS.'Case'.DS.'View'.DS.'Helper'.DS.'FormHelperTest.php'; |
|
589 | 589 | $this->Task->expects($this->once())->method('createFile') |
590 | 590 | ->with($path, $this->anything()); |
591 | 591 | |
@@ -599,14 +599,14 @@ discard block |
||
599 | 599 | * @return void |
600 | 600 | */ |
601 | 601 | public function testInteractiveWithPlugin() { |
602 | - $testApp = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS; |
|
602 | + $testApp = CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS; |
|
603 | 603 | App::build(array( |
604 | 604 | 'Plugin' => array($testApp) |
605 | 605 | ), App::RESET); |
606 | 606 | CakePlugin::load('TestPlugin'); |
607 | 607 | |
608 | 608 | $this->Task->plugin = 'TestPlugin'; |
609 | - $path = $testApp . 'TestPlugin' . DS . 'Test' . DS . 'Case' . DS . 'View' . DS . 'Helper' . DS . 'OtherHelperTest.php'; |
|
609 | + $path = $testApp.'TestPlugin'.DS.'Test'.DS.'Case'.DS.'View'.DS.'Helper'.DS.'OtherHelperTest.php'; |
|
610 | 610 | $this->Task->expects($this->any()) |
611 | 611 | ->method('in') |
612 | 612 | ->will($this->onConsecutiveCalls( |
@@ -627,16 +627,16 @@ discard block |
||
627 | 627 | |
628 | 628 | public static function caseFileNameProvider() { |
629 | 629 | return array( |
630 | - array('Model', 'Post', 'Case' . DS . 'Model' . DS . 'PostTest.php'), |
|
631 | - array('Helper', 'Form', 'Case' . DS . 'View' . DS . 'Helper' . DS . 'FormHelperTest.php'), |
|
632 | - array('Controller', 'Posts', 'Case' . DS . 'Controller' . DS . 'PostsControllerTest.php'), |
|
633 | - array('Behavior', 'Containable', 'Case' . DS . 'Model' . DS . 'Behavior' . DS . 'ContainableBehaviorTest.php'), |
|
634 | - array('Component', 'Auth', 'Case' . DS . 'Controller' . DS . 'Component' . DS . 'AuthComponentTest.php'), |
|
635 | - array('model', 'Post', 'Case' . DS . 'Model' . DS . 'PostTest.php'), |
|
636 | - array('helper', 'Form', 'Case' . DS . 'View' . DS . 'Helper' . DS . 'FormHelperTest.php'), |
|
637 | - array('controller', 'Posts', 'Case' . DS . 'Controller' . DS . 'PostsControllerTest.php'), |
|
638 | - array('behavior', 'Containable', 'Case' . DS . 'Model' . DS . 'Behavior' . DS . 'ContainableBehaviorTest.php'), |
|
639 | - array('component', 'Auth', 'Case' . DS . 'Controller' . DS . 'Component' . DS . 'AuthComponentTest.php'), |
|
630 | + array('Model', 'Post', 'Case'.DS.'Model'.DS.'PostTest.php'), |
|
631 | + array('Helper', 'Form', 'Case'.DS.'View'.DS.'Helper'.DS.'FormHelperTest.php'), |
|
632 | + array('Controller', 'Posts', 'Case'.DS.'Controller'.DS.'PostsControllerTest.php'), |
|
633 | + array('Behavior', 'Containable', 'Case'.DS.'Model'.DS.'Behavior'.DS.'ContainableBehaviorTest.php'), |
|
634 | + array('Component', 'Auth', 'Case'.DS.'Controller'.DS.'Component'.DS.'AuthComponentTest.php'), |
|
635 | + array('model', 'Post', 'Case'.DS.'Model'.DS.'PostTest.php'), |
|
636 | + array('helper', 'Form', 'Case'.DS.'View'.DS.'Helper'.DS.'FormHelperTest.php'), |
|
637 | + array('controller', 'Posts', 'Case'.DS.'Controller'.DS.'PostsControllerTest.php'), |
|
638 | + array('behavior', 'Containable', 'Case'.DS.'Model'.DS.'Behavior'.DS.'ContainableBehaviorTest.php'), |
|
639 | + array('component', 'Auth', 'Case'.DS.'Controller'.DS.'Component'.DS.'AuthComponentTest.php'), |
|
640 | 640 | ); |
641 | 641 | } |
642 | 642 | |
@@ -647,10 +647,10 @@ discard block |
||
647 | 647 | * @return void |
648 | 648 | */ |
649 | 649 | public function testTestCaseFileName($type, $class, $expected) { |
650 | - $this->Task->path = DS . 'my' . DS . 'path' . DS . 'tests' . DS; |
|
650 | + $this->Task->path = DS.'my'.DS.'path'.DS.'tests'.DS; |
|
651 | 651 | |
652 | 652 | $result = $this->Task->testCaseFileName($type, $class); |
653 | - $expected = $this->Task->path . $expected; |
|
653 | + $expected = $this->Task->path.$expected; |
|
654 | 654 | $this->assertEquals($expected, $result); |
655 | 655 | } |
656 | 656 | |
@@ -660,12 +660,12 @@ discard block |
||
660 | 660 | * @return void |
661 | 661 | */ |
662 | 662 | public function testTestCaseFileNamePlugin() { |
663 | - $this->Task->path = DS . 'my' . DS . 'path' . DS . 'tests' . DS; |
|
663 | + $this->Task->path = DS.'my'.DS.'path'.DS.'tests'.DS; |
|
664 | 664 | |
665 | - CakePlugin::load('TestTest', array('path' => APP . 'Plugin' . DS . 'TestTest' . DS)); |
|
665 | + CakePlugin::load('TestTest', array('path' => APP.'Plugin'.DS.'TestTest'.DS)); |
|
666 | 666 | $this->Task->plugin = 'TestTest'; |
667 | 667 | $result = $this->Task->testCaseFileName('Model', 'Post'); |
668 | - $expected = APP . 'Plugin' . DS . 'TestTest' . DS . 'Test' . DS . 'Case' . DS . 'Model' . DS . 'PostTest.php'; |
|
668 | + $expected = APP.'Plugin'.DS.'TestTest'.DS.'Test'.DS.'Case'.DS.'Model'.DS.'PostTest.php'; |
|
669 | 669 | $this->assertEquals($expected, $result); |
670 | 670 | } |
671 | 671 |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | |
201 | 201 | $this->Task->path = TMP; |
202 | 202 | $this->Task->Template->params['theme'] = 'default'; |
203 | - $this->Task->Template->templatePaths = array('default' => CAKE . 'Console' . DS . 'Templates' . DS . 'default' . DS); |
|
203 | + $this->Task->Template->templatePaths = array('default' => CAKE.'Console'.DS.'Templates'.DS.'default'.DS); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | |
293 | 293 | $this->Task->expects($this->at(0))->method('createFile') |
294 | 294 | ->with( |
295 | - TMP . 'ViewTaskComments' . DS . 'view.ctp', |
|
295 | + TMP.'ViewTaskComments'.DS.'view.ctp', |
|
296 | 296 | $this->stringContains('View Task Articles') |
297 | 297 | ); |
298 | 298 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | |
310 | 310 | $this->Task->expects($this->at(0))->method('createFile') |
311 | 311 | ->with( |
312 | - TMP . 'ViewTaskComments' . DS . 'edit.ctp', |
|
312 | + TMP.'ViewTaskComments'.DS.'edit.ctp', |
|
313 | 313 | new PHPUnit_Framework_Constraint_IsAnything() |
314 | 314 | ); |
315 | 315 | $this->Task->bake('edit', true); |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | |
326 | 326 | $this->Task->expects($this->at(0))->method('createFile') |
327 | 327 | ->with( |
328 | - TMP . 'ViewTaskComments' . DS . 'index.ctp', |
|
328 | + TMP.'ViewTaskComments'.DS.'index.ctp', |
|
329 | 329 | $this->stringContains("\$viewTaskComment['Article']['title']") |
330 | 330 | ); |
331 | 331 | $this->Task->bake('index', true); |
@@ -354,8 +354,8 @@ discard block |
||
354 | 354 | $this->Task->name = 'View'; |
355 | 355 | |
356 | 356 | //fake plugin path |
357 | - CakePlugin::load('TestTest', array('path' => APP . 'Plugin' . DS . 'TestTest' . DS)); |
|
358 | - $path = APP . 'Plugin' . DS . 'TestTest' . DS . 'View' . DS . 'ViewTaskComments' . DS . 'view.ctp'; |
|
357 | + CakePlugin::load('TestTest', array('path' => APP.'Plugin'.DS.'TestTest'.DS)); |
|
358 | + $path = APP.'Plugin'.DS.'TestTest'.DS.'View'.DS.'ViewTaskComments'.DS.'view.ctp'; |
|
359 | 359 | |
360 | 360 | $result = $this->Task->getContent('index'); |
361 | 361 | $this->assertNotContains('List Test Test.view Task Articles', $result); |
@@ -378,17 +378,17 @@ discard block |
||
378 | 378 | |
379 | 379 | $this->Task->expects($this->at(0))->method('createFile') |
380 | 380 | ->with( |
381 | - TMP . 'ViewTaskComments' . DS . 'view.ctp', |
|
381 | + TMP.'ViewTaskComments'.DS.'view.ctp', |
|
382 | 382 | $this->stringContains('View Task Comments') |
383 | 383 | ); |
384 | 384 | $this->Task->expects($this->at(1))->method('createFile') |
385 | 385 | ->with( |
386 | - TMP . 'ViewTaskComments' . DS . 'edit.ctp', |
|
386 | + TMP.'ViewTaskComments'.DS.'edit.ctp', |
|
387 | 387 | $this->stringContains('Edit View Task Comment') |
388 | 388 | ); |
389 | 389 | $this->Task->expects($this->at(2))->method('createFile') |
390 | 390 | ->with( |
391 | - TMP . 'ViewTaskComments' . DS . 'index.ctp', |
|
391 | + TMP.'ViewTaskComments'.DS.'index.ctp', |
|
392 | 392 | $this->stringContains('ViewTaskComment') |
393 | 393 | ); |
394 | 394 | |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | |
409 | 409 | $this->Task->expects($this->once())->method('createFile') |
410 | 410 | ->with( |
411 | - TMP . 'ViewTaskComments' . DS . 'my_action.ctp', |
|
411 | + TMP.'ViewTaskComments'.DS.'my_action.ctp', |
|
412 | 412 | $this->anything() |
413 | 413 | ); |
414 | 414 | |
@@ -428,12 +428,12 @@ discard block |
||
428 | 428 | |
429 | 429 | $this->Task->expects($this->at(0))->method('createFile') |
430 | 430 | ->with( |
431 | - TMP . 'ViewTaskComments' . DS . 'index.ctp', |
|
431 | + TMP.'ViewTaskComments'.DS.'index.ctp', |
|
432 | 432 | $this->anything() |
433 | 433 | ); |
434 | 434 | $this->Task->expects($this->at(1))->method('createFile') |
435 | 435 | ->with( |
436 | - TMP . 'ViewTaskComments' . DS . 'add.ctp', |
|
436 | + TMP.'ViewTaskComments'.DS.'add.ctp', |
|
437 | 437 | $this->anything() |
438 | 438 | ); |
439 | 439 | $this->Task->expects($this->exactly(2))->method('createFile'); |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | |
455 | 455 | $this->Task->expects($this->once())->method('createFile') |
456 | 456 | ->with( |
457 | - TMP . 'ViewTaskComments' . DS . 'index.ctp', |
|
457 | + TMP.'ViewTaskComments'.DS.'index.ctp', |
|
458 | 458 | $this->anything() |
459 | 459 | ); |
460 | 460 | |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | |
473 | 473 | $this->Task->expects($this->once())->method('createFile') |
474 | 474 | ->with( |
475 | - TMP . 'ViewTaskComments' . DS . 'view.ctp', |
|
475 | + TMP.'ViewTaskComments'.DS.'view.ctp', |
|
476 | 476 | $this->anything() |
477 | 477 | ); |
478 | 478 | $this->Task->execute(); |
@@ -489,12 +489,12 @@ discard block |
||
489 | 489 | |
490 | 490 | $this->Task->expects($this->at(0))->method('createFile') |
491 | 491 | ->with( |
492 | - TMP . 'ViewTaskComments' . DS . 'index.ctp', |
|
492 | + TMP.'ViewTaskComments'.DS.'index.ctp', |
|
493 | 493 | $this->anything() |
494 | 494 | ); |
495 | 495 | $this->Task->expects($this->at(1))->method('createFile') |
496 | 496 | ->with( |
497 | - TMP . 'ViewTaskComments' . DS . 'add.ctp', |
|
497 | + TMP.'ViewTaskComments'.DS.'add.ctp', |
|
498 | 498 | $this->anything() |
499 | 499 | ); |
500 | 500 | $this->Task->expects($this->exactly(2))->method('createFile'); |
@@ -522,12 +522,12 @@ discard block |
||
522 | 522 | |
523 | 523 | $this->Task->expects($this->at(0))->method('createFile') |
524 | 524 | ->with( |
525 | - TMP . 'ViewTaskComments' . DS . 'index.ctp', |
|
525 | + TMP.'ViewTaskComments'.DS.'index.ctp', |
|
526 | 526 | $this->anything() |
527 | 527 | ); |
528 | 528 | $this->Task->expects($this->at(1))->method('createFile') |
529 | 529 | ->with( |
530 | - TMP . 'ViewTaskComments' . DS . 'add.ctp', |
|
530 | + TMP.'ViewTaskComments'.DS.'add.ctp', |
|
531 | 531 | $this->anything() |
532 | 532 | ); |
533 | 533 | $this->Task->execute(); |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | foreach ($views as $i => $view) { |
554 | 554 | $this->Task->expects($this->at($i))->method('createFile') |
555 | 555 | ->with( |
556 | - TMP . 'ViewTaskArticles' . DS . $view, |
|
556 | + TMP.'ViewTaskArticles'.DS.$view, |
|
557 | 557 | $this->anything() |
558 | 558 | ); |
559 | 559 | } |
@@ -579,25 +579,25 @@ discard block |
||
579 | 579 | |
580 | 580 | $this->Task->expects($this->at(3))->method('createFile') |
581 | 581 | ->with( |
582 | - TMP . 'ViewTaskComments' . DS . 'index.ctp', |
|
582 | + TMP.'ViewTaskComments'.DS.'index.ctp', |
|
583 | 583 | $this->stringContains('ViewTaskComment') |
584 | 584 | ); |
585 | 585 | |
586 | 586 | $this->Task->expects($this->at(4))->method('createFile') |
587 | 587 | ->with( |
588 | - TMP . 'ViewTaskComments' . DS . 'view.ctp', |
|
588 | + TMP.'ViewTaskComments'.DS.'view.ctp', |
|
589 | 589 | $this->stringContains('ViewTaskComment') |
590 | 590 | ); |
591 | 591 | |
592 | 592 | $this->Task->expects($this->at(5))->method('createFile') |
593 | 593 | ->with( |
594 | - TMP . 'ViewTaskComments' . DS . 'add.ctp', |
|
594 | + TMP.'ViewTaskComments'.DS.'add.ctp', |
|
595 | 595 | $this->stringContains('Add View Task Comment') |
596 | 596 | ); |
597 | 597 | |
598 | 598 | $this->Task->expects($this->at(6))->method('createFile') |
599 | 599 | ->with( |
600 | - TMP . 'ViewTaskComments' . DS . 'edit.ctp', |
|
600 | + TMP.'ViewTaskComments'.DS.'edit.ctp', |
|
601 | 601 | $this->stringContains('Edit View Task Comment') |
602 | 602 | ); |
603 | 603 | |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | |
618 | 618 | $this->Task->expects($this->once())->method('createFile') |
619 | 619 | ->with( |
620 | - TMP . 'ViewTaskComments' . DS . 'list.ctp', |
|
620 | + TMP.'ViewTaskComments'.DS.'list.ctp', |
|
621 | 621 | $this->stringContains('ViewTaskComment') |
622 | 622 | ); |
623 | 623 | $this->Task->execute(); |
@@ -644,25 +644,25 @@ discard block |
||
644 | 644 | |
645 | 645 | $this->Task->expects($this->at(3))->method('createFile') |
646 | 646 | ->with( |
647 | - TMP . 'ViewTaskComments' . DS . 'admin_index.ctp', |
|
647 | + TMP.'ViewTaskComments'.DS.'admin_index.ctp', |
|
648 | 648 | $this->stringContains('ViewTaskComment') |
649 | 649 | ); |
650 | 650 | |
651 | 651 | $this->Task->expects($this->at(4))->method('createFile') |
652 | 652 | ->with( |
653 | - TMP . 'ViewTaskComments' . DS . 'admin_view.ctp', |
|
653 | + TMP.'ViewTaskComments'.DS.'admin_view.ctp', |
|
654 | 654 | $this->stringContains('ViewTaskComment') |
655 | 655 | ); |
656 | 656 | |
657 | 657 | $this->Task->expects($this->at(5))->method('createFile') |
658 | 658 | ->with( |
659 | - TMP . 'ViewTaskComments' . DS . 'admin_add.ctp', |
|
659 | + TMP.'ViewTaskComments'.DS.'admin_add.ctp', |
|
660 | 660 | $this->stringContains('Add View Task Comment') |
661 | 661 | ); |
662 | 662 | |
663 | 663 | $this->Task->expects($this->at(6))->method('createFile') |
664 | 664 | ->with( |
665 | - TMP . 'ViewTaskComments' . DS . 'admin_edit.ctp', |
|
665 | + TMP.'ViewTaskComments'.DS.'admin_edit.ctp', |
|
666 | 666 | $this->stringContains('Edit View Task Comment') |
667 | 667 | ); |
668 | 668 | |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | $this->assertEquals('form', $result); |
689 | 689 | |
690 | 690 | $this->Task->Template->templatePaths = array( |
691 | - 'test' => CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Templates' . DS . 'test' . DS |
|
691 | + 'test' => CAKE.'Test'.DS.'test_app'.DS.'Console'.DS.'Templates'.DS.'test'.DS |
|
692 | 692 | ); |
693 | 693 | $this->Task->Template->params['theme'] = 'test'; |
694 | 694 |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | public function testMapAppFileToCategory() { |
118 | 118 | $this->Shell->startup(); |
119 | 119 | |
120 | - $return = $this->Shell->mapFileToCategory(APP . 'Controller/ExampleController.php'); |
|
120 | + $return = $this->Shell->mapFileToCategory(APP.'Controller/ExampleController.php'); |
|
121 | 121 | $this->assertSame('app', $return); |
122 | 122 | |
123 | - $return = $this->Shell->mapFileToCategory(APP . 'My/File/Is/Here.php'); |
|
123 | + $return = $this->Shell->mapFileToCategory(APP.'My/File/Is/Here.php'); |
|
124 | 124 | $this->assertSame('app', $return); |
125 | 125 | } |
126 | 126 | |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | public function testMapAppFileToCase() { |
133 | 133 | $this->Shell->startup(); |
134 | 134 | |
135 | - $return = $this->Shell->mapFileToCase(APP . 'Controller/ExampleController.php', 'app', false); |
|
135 | + $return = $this->Shell->mapFileToCase(APP.'Controller/ExampleController.php', 'app', false); |
|
136 | 136 | $this->assertSame('Controller/ExampleController', $return); |
137 | 137 | |
138 | - $return = $this->Shell->mapFileToCase(APP . 'My/File/Is/Here.php', 'app', false); |
|
138 | + $return = $this->Shell->mapFileToCase(APP.'My/File/Is/Here.php', 'app', false); |
|
139 | 139 | $this->assertSame('My/File/Is/Here', $return); |
140 | 140 | } |
141 | 141 | |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | public function testMapPluginFileToCategory() { |
148 | 148 | $this->Shell->startup(); |
149 | 149 | |
150 | - $return = $this->Shell->mapFileToCategory(APP . 'Plugin/awesome/Controller/ExampleController.php'); |
|
150 | + $return = $this->Shell->mapFileToCategory(APP.'Plugin/awesome/Controller/ExampleController.php'); |
|
151 | 151 | $this->assertSame('awesome', $return); |
152 | 152 | |
153 | - $return = $this->Shell->mapFileToCategory(dirname(CAKE) . 'plugins/awesome/Controller/ExampleController.php'); |
|
153 | + $return = $this->Shell->mapFileToCategory(dirname(CAKE).'plugins/awesome/Controller/ExampleController.php'); |
|
154 | 154 | $this->assertSame('awesome', $return); |
155 | 155 | } |
156 | 156 | |
@@ -162,10 +162,10 @@ discard block |
||
162 | 162 | public function testMapPluginFileToCase() { |
163 | 163 | $this->Shell->startup(); |
164 | 164 | |
165 | - $return = $this->Shell->mapFileToCase(APP . 'Plugin/awesome/Controller/ExampleController.php', 'awesome', false); |
|
165 | + $return = $this->Shell->mapFileToCase(APP.'Plugin/awesome/Controller/ExampleController.php', 'awesome', false); |
|
166 | 166 | $this->assertSame('Controller/ExampleController', $return); |
167 | 167 | |
168 | - $return = $this->Shell->mapFileToCase(dirname(CAKE) . 'plugins/awesome/Controller/ExampleController.php', 'awesome', false); |
|
168 | + $return = $this->Shell->mapFileToCase(dirname(CAKE).'plugins/awesome/Controller/ExampleController.php', 'awesome', false); |
|
169 | 169 | $this->assertSame('Controller/ExampleController', $return); |
170 | 170 | } |
171 | 171 | |
@@ -215,10 +215,10 @@ discard block |
||
215 | 215 | public function testMapAppTestToCategory() { |
216 | 216 | $this->Shell->startup(); |
217 | 217 | |
218 | - $return = $this->Shell->mapFileToCategory(APP . 'Test/Case/Controller/ExampleControllerTest.php'); |
|
218 | + $return = $this->Shell->mapFileToCategory(APP.'Test/Case/Controller/ExampleControllerTest.php'); |
|
219 | 219 | $this->assertSame('app', $return); |
220 | 220 | |
221 | - $return = $this->Shell->mapFileToCategory(APP . 'Test/Case/My/File/Is/HereTest.php'); |
|
221 | + $return = $this->Shell->mapFileToCategory(APP.'Test/Case/My/File/Is/HereTest.php'); |
|
222 | 222 | $this->assertSame('app', $return); |
223 | 223 | } |
224 | 224 | |
@@ -230,10 +230,10 @@ discard block |
||
230 | 230 | public function testMapAppTestToCase() { |
231 | 231 | $this->Shell->startup(); |
232 | 232 | |
233 | - $return = $this->Shell->mapFileToCase(APP . 'Test/Case/Controller/ExampleControllerTest.php', 'app', false); |
|
233 | + $return = $this->Shell->mapFileToCase(APP.'Test/Case/Controller/ExampleControllerTest.php', 'app', false); |
|
234 | 234 | $this->assertSame('Controller/ExampleController', $return); |
235 | 235 | |
236 | - $return = $this->Shell->mapFileToCase(APP . 'Test/Case/My/File/Is/HereTest.php', 'app', false); |
|
236 | + $return = $this->Shell->mapFileToCase(APP.'Test/Case/My/File/Is/HereTest.php', 'app', false); |
|
237 | 237 | $this->assertSame('My/File/Is/Here', $return); |
238 | 238 | } |
239 | 239 | |
@@ -245,10 +245,10 @@ discard block |
||
245 | 245 | public function testMapPluginTestToCategory() { |
246 | 246 | $this->Shell->startup(); |
247 | 247 | |
248 | - $return = $this->Shell->mapFileToCategory(APP . 'Plugin/awesome/Test/Case/Controller/ExampleControllerTest.php'); |
|
248 | + $return = $this->Shell->mapFileToCategory(APP.'Plugin/awesome/Test/Case/Controller/ExampleControllerTest.php'); |
|
249 | 249 | $this->assertSame('awesome', $return); |
250 | 250 | |
251 | - $return = $this->Shell->mapFileToCategory(dirname(CAKE) . 'plugins/awesome/Test/Case/Controller/ExampleControllerTest.php'); |
|
251 | + $return = $this->Shell->mapFileToCategory(dirname(CAKE).'plugins/awesome/Test/Case/Controller/ExampleControllerTest.php'); |
|
252 | 252 | $this->assertSame('awesome', $return); |
253 | 253 | } |
254 | 254 | |
@@ -260,10 +260,10 @@ discard block |
||
260 | 260 | public function testMapPluginTestToCase() { |
261 | 261 | $this->Shell->startup(); |
262 | 262 | |
263 | - $return = $this->Shell->mapFileToCase(APP . 'Plugin/awesome/Test/Case/Controller/ExampleControllerTest.php', 'awesome', false); |
|
263 | + $return = $this->Shell->mapFileToCase(APP.'Plugin/awesome/Test/Case/Controller/ExampleControllerTest.php', 'awesome', false); |
|
264 | 264 | $this->assertSame('Controller/ExampleController', $return); |
265 | 265 | |
266 | - $return = $this->Shell->mapFileToCase(dirname(CAKE) . 'plugins/awesome/Test/Case/Controller/ExampleControllerTest.php', 'awesome', false); |
|
266 | + $return = $this->Shell->mapFileToCase(dirname(CAKE).'plugins/awesome/Test/Case/Controller/ExampleControllerTest.php', 'awesome', false); |
|
267 | 267 | $this->assertSame('Controller/ExampleController', $return); |
268 | 268 | } |
269 | 269 | |
@@ -275,16 +275,16 @@ discard block |
||
275 | 275 | public function testMapNotTestToNothing() { |
276 | 276 | $this->Shell->startup(); |
277 | 277 | |
278 | - $return = $this->Shell->mapFileToCategory(APP . 'Test/Case/NotATestFile.php'); |
|
278 | + $return = $this->Shell->mapFileToCategory(APP.'Test/Case/NotATestFile.php'); |
|
279 | 279 | $this->assertSame('app', $return); |
280 | 280 | |
281 | - $return = $this->Shell->mapFileToCase(APP . 'Test/Case/NotATestFile.php', false, false); |
|
281 | + $return = $this->Shell->mapFileToCase(APP.'Test/Case/NotATestFile.php', false, false); |
|
282 | 282 | $this->assertFalse($return); |
283 | 283 | |
284 | - $return = $this->Shell->mapFileToCategory(APP . 'Test/Fixture/SomeTest.php'); |
|
284 | + $return = $this->Shell->mapFileToCategory(APP.'Test/Fixture/SomeTest.php'); |
|
285 | 285 | $this->assertSame('app', $return); |
286 | 286 | |
287 | - $return = $this->Shell->mapFileToCase(APP . 'Test/Fixture/SomeTest.php', false, false); |
|
287 | + $return = $this->Shell->mapFileToCase(APP.'Test/Fixture/SomeTest.php', false, false); |
|
288 | 288 | $this->assertFalse($return); |
289 | 289 | } |
290 | 290 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function testWriteNewLine() { |
67 | 67 | $this->output->expects($this->once())->method('_write') |
68 | - ->with('Some output' . PHP_EOL); |
|
68 | + ->with('Some output'.PHP_EOL); |
|
69 | 69 | |
70 | 70 | $this->output->write('Some output'); |
71 | 71 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function testWriteMultipleNewLines() { |
79 | 79 | $this->output->expects($this->once())->method('_write') |
80 | - ->with('Some output' . PHP_EOL . PHP_EOL . PHP_EOL . PHP_EOL); |
|
80 | + ->with('Some output'.PHP_EOL.PHP_EOL.PHP_EOL.PHP_EOL); |
|
81 | 81 | |
82 | 82 | $this->output->write('Some output', 4); |
83 | 83 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function testWriteArray() { |
91 | 91 | $this->output->expects($this->once())->method('_write') |
92 | - ->with('Line' . PHP_EOL . 'Line' . PHP_EOL . 'Line' . PHP_EOL); |
|
92 | + ->with('Line'.PHP_EOL.'Line'.PHP_EOL.'Line'.PHP_EOL); |
|
93 | 93 | |
94 | 94 | $this->output->write(array('Line', 'Line', 'Line')); |
95 | 95 | } |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | $in = $this->getMock('ConsoleInput', array(), array(), '', false); |
145 | 145 | $this->Shell = new ShellTestShell($output, $error, $in); |
146 | 146 | |
147 | - if (is_dir(TMP . 'shell_test')) { |
|
148 | - $Folder = new Folder(TMP . 'shell_test'); |
|
147 | + if (is_dir(TMP.'shell_test')) { |
|
148 | + $Folder = new Folder(TMP.'shell_test'); |
|
149 | 149 | $Folder->delete(); |
150 | 150 | } |
151 | 151 | } |
@@ -188,8 +188,8 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public function testInitialize() { |
190 | 190 | App::build(array( |
191 | - 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), |
|
192 | - 'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS) |
|
191 | + 'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS), |
|
192 | + 'Model' => array(CAKE.'Test'.DS.'test_app'.DS.'Model'.DS) |
|
193 | 193 | ), App::RESET); |
194 | 194 | |
195 | 195 | CakePlugin::load('TestPlugin'); |
@@ -219,8 +219,8 @@ discard block |
||
219 | 219 | */ |
220 | 220 | public function testLoadModel() { |
221 | 221 | App::build(array( |
222 | - 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), |
|
223 | - 'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS) |
|
222 | + 'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS), |
|
223 | + 'Model' => array(CAKE.'Test'.DS.'test_app'.DS.'Model'.DS) |
|
224 | 224 | ), App::RESET); |
225 | 225 | |
226 | 226 | $Shell = new TestMergeShell(); |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | $this->assertEquals($this->Shell->nl(), $newLine); |
413 | 413 | $this->assertEquals($this->Shell->nl(true), $newLine); |
414 | 414 | $this->assertEquals("", $this->Shell->nl(false)); |
415 | - $this->assertEquals($this->Shell->nl(2), $newLine . $newLine); |
|
415 | + $this->assertEquals($this->Shell->nl(2), $newLine.$newLine); |
|
416 | 416 | $this->assertEquals($this->Shell->nl(1), $newLine); |
417 | 417 | } |
418 | 418 | |
@@ -531,33 +531,33 @@ discard block |
||
531 | 531 | * @return void |
532 | 532 | */ |
533 | 533 | public function testShortPath() { |
534 | - $path = $expected = DS . 'tmp' . DS . 'ab' . DS . 'cd'; |
|
534 | + $path = $expected = DS.'tmp'.DS.'ab'.DS.'cd'; |
|
535 | 535 | $this->assertEquals($expected, $this->Shell->shortPath($path)); |
536 | 536 | |
537 | - $path = $expected = DS . 'tmp' . DS . 'ab' . DS . 'cd' . DS; |
|
537 | + $path = $expected = DS.'tmp'.DS.'ab'.DS.'cd'.DS; |
|
538 | 538 | $this->assertEquals($expected, $this->Shell->shortPath($path)); |
539 | 539 | |
540 | - $path = $expected = DS . 'tmp' . DS . 'ab' . DS . 'index.php'; |
|
540 | + $path = $expected = DS.'tmp'.DS.'ab'.DS.'index.php'; |
|
541 | 541 | $this->assertEquals($expected, $this->Shell->shortPath($path)); |
542 | 542 | |
543 | - $path = DS . 'tmp' . DS . 'ab' . DS . DS . 'cd'; |
|
544 | - $expected = DS . 'tmp' . DS . 'ab' . DS . 'cd'; |
|
543 | + $path = DS.'tmp'.DS.'ab'.DS.DS.'cd'; |
|
544 | + $expected = DS.'tmp'.DS.'ab'.DS.'cd'; |
|
545 | 545 | $this->assertEquals($expected, $this->Shell->shortPath($path)); |
546 | 546 | |
547 | - $path = 'tmp' . DS . 'ab'; |
|
548 | - $expected = 'tmp' . DS . 'ab'; |
|
547 | + $path = 'tmp'.DS.'ab'; |
|
548 | + $expected = 'tmp'.DS.'ab'; |
|
549 | 549 | $this->assertEquals($expected, $this->Shell->shortPath($path)); |
550 | 550 | |
551 | - $path = 'tmp' . DS . 'ab'; |
|
552 | - $expected = 'tmp' . DS . 'ab'; |
|
551 | + $path = 'tmp'.DS.'ab'; |
|
552 | + $expected = 'tmp'.DS.'ab'; |
|
553 | 553 | $this->assertEquals($expected, $this->Shell->shortPath($path)); |
554 | 554 | |
555 | 555 | $path = APP; |
556 | - $expected = DS . basename(APP) . DS; |
|
556 | + $expected = DS.basename(APP).DS; |
|
557 | 557 | $this->assertEquals($expected, $this->Shell->shortPath($path)); |
558 | 558 | |
559 | - $path = APP . 'index.php'; |
|
560 | - $expected = DS . basename(APP) . DS . 'index.php'; |
|
559 | + $path = APP.'index.php'; |
|
560 | + $expected = DS.basename(APP).DS.'index.php'; |
|
561 | 561 | $this->assertEquals($expected, $this->Shell->shortPath($path)); |
562 | 562 | } |
563 | 563 | |
@@ -569,8 +569,8 @@ discard block |
||
569 | 569 | public function testCreateFileNonInteractive() { |
570 | 570 | $eol = PHP_EOL; |
571 | 571 | |
572 | - $path = TMP . 'shell_test'; |
|
573 | - $file = $path . DS . 'file1.php'; |
|
572 | + $path = TMP.'shell_test'; |
|
573 | + $file = $path.DS.'file1.php'; |
|
574 | 574 | |
575 | 575 | new Folder($path, true); |
576 | 576 | |
@@ -597,8 +597,8 @@ discard block |
||
597 | 597 | public function testCreateFileInteractive() { |
598 | 598 | $eol = PHP_EOL; |
599 | 599 | |
600 | - $path = TMP . 'shell_test'; |
|
601 | - $file = $path . DS . 'file1.php'; |
|
600 | + $path = TMP.'shell_test'; |
|
601 | + $file = $path.DS.'file1.php'; |
|
602 | 602 | new Folder($path, true); |
603 | 603 | |
604 | 604 | $this->Shell->interactive = true; |
@@ -640,10 +640,10 @@ discard block |
||
640 | 640 | public function testCreateFileNoPermissions() { |
641 | 641 | $this->skipIf(DIRECTORY_SEPARATOR === '\\', 'Cant perform operations using permissions on windows.'); |
642 | 642 | |
643 | - $path = TMP . 'shell_test'; |
|
644 | - $file = $path . DS . 'no_perms'; |
|
643 | + $path = TMP.'shell_test'; |
|
644 | + $file = $path.DS.'no_perms'; |
|
645 | 645 | |
646 | - if (!is_dir($path)) { |
|
646 | + if ( ! is_dir($path)) { |
|
647 | 647 | mkdir($path); |
648 | 648 | } |
649 | 649 | chmod($path, 0444); |
@@ -846,13 +846,13 @@ discard block |
||
846 | 846 | public function testFileAndConsoleLogging() { |
847 | 847 | // file logging |
848 | 848 | $this->Shell->log_something(); |
849 | - $this->assertTrue(file_exists(LOGS . 'error.log')); |
|
849 | + $this->assertTrue(file_exists(LOGS.'error.log')); |
|
850 | 850 | |
851 | - unlink(LOGS . 'error.log'); |
|
852 | - $this->assertFalse(file_exists(LOGS . 'error.log')); |
|
851 | + unlink(LOGS.'error.log'); |
|
852 | + $this->assertFalse(file_exists(LOGS.'error.log')); |
|
853 | 853 | |
854 | 854 | // both file and console logging |
855 | - require_once CORE_TEST_CASES . DS . 'Log' . DS . 'Engine' . DS . 'ConsoleLogTest.php'; |
|
855 | + require_once CORE_TEST_CASES.DS.'Log'.DS.'Engine'.DS.'ConsoleLogTest.php'; |
|
856 | 856 | $mock = $this->getMock('ConsoleLog', array('write'), array( |
857 | 857 | array('types' => 'error'), |
858 | 858 | )); |
@@ -865,8 +865,8 @@ discard block |
||
865 | 865 | ->method('write') |
866 | 866 | ->with('error', $this->Shell->testMessage); |
867 | 867 | $this->Shell->log_something(); |
868 | - $this->assertTrue(file_exists(LOGS . 'error.log')); |
|
869 | - $contents = file_get_contents(LOGS . 'error.log'); |
|
868 | + $this->assertTrue(file_exists(LOGS.'error.log')); |
|
869 | + $contents = file_get_contents(LOGS.'error.log'); |
|
870 | 870 | $this->assertContains($this->Shell->testMessage, $contents); |
871 | 871 | } |
872 | 872 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @return void |
32 | 32 | */ |
33 | 33 | public function testCheck() { |
34 | - $iniFile = CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS . 'acl.ini.php'; |
|
34 | + $iniFile = CAKE.'Test'.DS.'test_app'.DS.'Config'.DS.'acl.ini.php'; |
|
35 | 35 | |
36 | 36 | $Ini = new IniAcl(); |
37 | 37 | $Ini->config = $Ini->readConfigFile($iniFile); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @return void |
55 | 55 | */ |
56 | 56 | public function testCheckArray() { |
57 | - $iniFile = CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS . 'acl.ini.php'; |
|
57 | + $iniFile = CAKE.'Test'.DS.'test_app'.DS.'Config'.DS.'acl.ini.php'; |
|
58 | 58 | |
59 | 59 | $Ini = new IniAcl(); |
60 | 60 | $Ini->config = $Ini->readConfigFile($iniFile); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | $this->PhpAcl = new PhpAcl(); |
40 | 40 | $this->Acl = new AclComponent($Collection, array( |
41 | 41 | 'adapter' => array( |
42 | - 'config' => CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS . 'acl.php', |
|
42 | + 'config' => CAKE.'Test'.DS.'test_app'.DS.'Config'.DS.'acl.php', |
|
43 | 43 | ), |
44 | 44 | )); |
45 | 45 | } |