@@ -33,9 +33,9 @@ |
||
33 | 33 | public static function suite() { |
34 | 34 | $suite = new CakeTestSuite('All Network related class tests'); |
35 | 35 | |
36 | - $suite->addTestDirectory(CORE_TEST_CASES . DS . 'Network'); |
|
37 | - $suite->addTestDirectory(CORE_TEST_CASES . DS . 'Network' . DS . 'Email'); |
|
38 | - $suite->addTestDirectory(CORE_TEST_CASES . DS . 'Network' . DS . 'Http'); |
|
36 | + $suite->addTestDirectory(CORE_TEST_CASES.DS.'Network'); |
|
37 | + $suite->addTestDirectory(CORE_TEST_CASES.DS.'Network'.DS.'Email'); |
|
38 | + $suite->addTestDirectory(CORE_TEST_CASES.DS.'Network'.DS.'Http'); |
|
39 | 39 | return $suite; |
40 | 40 | } |
41 | 41 | } |
@@ -33,11 +33,11 @@ |
||
33 | 33 | public static function suite() { |
34 | 34 | $suite = new CakeTestSuite('All Routing class tests'); |
35 | 35 | |
36 | - $libs = CORE_TEST_CASES . DS; |
|
36 | + $libs = CORE_TEST_CASES.DS; |
|
37 | 37 | |
38 | - $suite->addTestDirectory($libs . 'Routing'); |
|
39 | - $suite->addTestDirectory($libs . 'Routing' . DS . 'Route'); |
|
40 | - $suite->addTestDirectory($libs . 'Routing' . DS . 'Filter'); |
|
38 | + $suite->addTestDirectory($libs.'Routing'); |
|
39 | + $suite->addTestDirectory($libs.'Routing'.DS.'Route'); |
|
40 | + $suite->addTestDirectory($libs.'Routing'.DS.'Filter'); |
|
41 | 41 | return $suite; |
42 | 42 | } |
43 | 43 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | public static function suite() { |
34 | 34 | $suite = new CakeTestSuite('All Test Suite classes tests'); |
35 | 35 | |
36 | - $suite->addTestDirectory(CORE_TEST_CASES . DS . 'TestSuite'); |
|
36 | + $suite->addTestDirectory(CORE_TEST_CASES.DS.'TestSuite'); |
|
37 | 37 | return $suite; |
38 | 38 | } |
39 | 39 | } |
@@ -33,28 +33,28 @@ |
||
33 | 33 | public static function suite() { |
34 | 34 | $suite = new PHPUnit_Framework_TestSuite('All Tests'); |
35 | 35 | |
36 | - $path = CORE_TEST_CASES . DS; |
|
36 | + $path = CORE_TEST_CASES.DS; |
|
37 | 37 | |
38 | - $suite->addTestFile($path . 'BasicsTest.php'); |
|
39 | - $suite->addTestFile($path . 'AllConsoleTest.php'); |
|
40 | - $suite->addTestFile($path . 'AllBehaviorsTest.php'); |
|
41 | - $suite->addTestFile($path . 'AllCacheTest.php'); |
|
42 | - $suite->addTestFile($path . 'AllComponentsTest.php'); |
|
43 | - $suite->addTestFile($path . 'AllConfigureTest.php'); |
|
44 | - $suite->addTestFile($path . 'AllCoreTest.php'); |
|
45 | - $suite->addTestFile($path . 'AllControllerTest.php'); |
|
46 | - $suite->addTestFile($path . 'AllDatabaseTest.php'); |
|
47 | - $suite->addTestFile($path . 'AllErrorTest.php'); |
|
48 | - $suite->addTestFile($path . 'AllEventTest.php'); |
|
49 | - $suite->addTestFile($path . 'AllHelpersTest.php'); |
|
50 | - $suite->addTestFile($path . 'AllLogTest.php'); |
|
51 | - $suite->addTestFile($path . 'Model' . DS . 'ModelTest.php'); |
|
52 | - $suite->addTestFile($path . 'AllRoutingTest.php'); |
|
53 | - $suite->addTestFile($path . 'AllNetworkTest.php'); |
|
54 | - $suite->addTestFile($path . 'AllTestSuiteTest.php'); |
|
55 | - $suite->addTestFile($path . 'AllUtilityTest.php'); |
|
56 | - $suite->addTestFile($path . 'AllViewTest.php'); |
|
57 | - $suite->addTestFile($path . 'AllI18nTest.php'); |
|
38 | + $suite->addTestFile($path.'BasicsTest.php'); |
|
39 | + $suite->addTestFile($path.'AllConsoleTest.php'); |
|
40 | + $suite->addTestFile($path.'AllBehaviorsTest.php'); |
|
41 | + $suite->addTestFile($path.'AllCacheTest.php'); |
|
42 | + $suite->addTestFile($path.'AllComponentsTest.php'); |
|
43 | + $suite->addTestFile($path.'AllConfigureTest.php'); |
|
44 | + $suite->addTestFile($path.'AllCoreTest.php'); |
|
45 | + $suite->addTestFile($path.'AllControllerTest.php'); |
|
46 | + $suite->addTestFile($path.'AllDatabaseTest.php'); |
|
47 | + $suite->addTestFile($path.'AllErrorTest.php'); |
|
48 | + $suite->addTestFile($path.'AllEventTest.php'); |
|
49 | + $suite->addTestFile($path.'AllHelpersTest.php'); |
|
50 | + $suite->addTestFile($path.'AllLogTest.php'); |
|
51 | + $suite->addTestFile($path.'Model'.DS.'ModelTest.php'); |
|
52 | + $suite->addTestFile($path.'AllRoutingTest.php'); |
|
53 | + $suite->addTestFile($path.'AllNetworkTest.php'); |
|
54 | + $suite->addTestFile($path.'AllTestSuiteTest.php'); |
|
55 | + $suite->addTestFile($path.'AllUtilityTest.php'); |
|
56 | + $suite->addTestFile($path.'AllViewTest.php'); |
|
57 | + $suite->addTestFile($path.'AllI18nTest.php'); |
|
58 | 58 | return $suite; |
59 | 59 | } |
60 | 60 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | public static function suite() { |
34 | 34 | $suite = new CakeTestSuite('All Utility class tests'); |
35 | - $suite->addTestDirectory(CORE_TEST_CASES . DS . 'Utility'); |
|
35 | + $suite->addTestDirectory(CORE_TEST_CASES.DS.'Utility'); |
|
36 | 36 | return $suite; |
37 | 37 | } |
38 | 38 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | public static function suite() { |
34 | 34 | $suite = new CakeTestSuite('All View class tests'); |
35 | 35 | |
36 | - $suite->addTestDirectory(CORE_TEST_CASES . DS . 'View'); |
|
36 | + $suite->addTestDirectory(CORE_TEST_CASES.DS.'View'); |
|
37 | 37 | return $suite; |
38 | 38 | } |
39 | 39 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * @license http://www.opensource.org/licenses/mit-license.php MIT License |
17 | 17 | */ |
18 | 18 | |
19 | -require_once CAKE . 'basics.php'; |
|
19 | +require_once CAKE.'basics.php'; |
|
20 | 20 | |
21 | 21 | App::uses('Folder', 'Utility'); |
22 | 22 | App::uses('CakeResponse', 'Network'); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | public function setUp() { |
37 | 37 | parent::setUp(); |
38 | 38 | App::build(array( |
39 | - 'Locale' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS) |
|
39 | + 'Locale' => array(CAKE.'Test'.DS.'test_app'.DS.'Locale'.DS) |
|
40 | 40 | )); |
41 | 41 | } |
42 | 42 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @return void |
77 | 77 | */ |
78 | 78 | public function testEnv() { |
79 | - $this->skipIf(!function_exists('ini_get') || ini_get('safe_mode') === '1', 'Safe mode is on.'); |
|
79 | + $this->skipIf( ! function_exists('ini_get') || ini_get('safe_mode') === '1', 'Safe mode is on.'); |
|
80 | 80 | |
81 | 81 | $server = $_SERVER; |
82 | 82 | $env = $_ENV; |
@@ -277,13 +277,13 @@ discard block |
||
277 | 277 | |
278 | 278 | Configure::write('Cache.disable', false); |
279 | 279 | $result = cache('basics_test', 'simple cache write'); |
280 | - $this->assertTrue((bool)$result); |
|
281 | - $this->assertTrue(file_exists(CACHE . 'basics_test')); |
|
280 | + $this->assertTrue((bool) $result); |
|
281 | + $this->assertTrue(file_exists(CACHE.'basics_test')); |
|
282 | 282 | |
283 | 283 | $result = cache('basics_test'); |
284 | 284 | $this->assertEquals('simple cache write', $result); |
285 | - if (file_exists(CACHE . 'basics_test')) { |
|
286 | - unlink(CACHE . 'basics_test'); |
|
285 | + if (file_exists(CACHE.'basics_test')) { |
|
286 | + unlink(CACHE.'basics_test'); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | cache('basics_test', 'expired', '+1 second'); |
@@ -303,56 +303,56 @@ discard block |
||
303 | 303 | $cacheOff = Configure::read('Cache.disable'); |
304 | 304 | $this->skipIf($cacheOff, 'Cache is disabled, skipping clearCache() tests.'); |
305 | 305 | |
306 | - cache('views' . DS . 'basics_test.cache', 'simple cache write'); |
|
307 | - $this->assertTrue(file_exists(CACHE . 'views' . DS . 'basics_test.cache')); |
|
306 | + cache('views'.DS.'basics_test.cache', 'simple cache write'); |
|
307 | + $this->assertTrue(file_exists(CACHE.'views'.DS.'basics_test.cache')); |
|
308 | 308 | |
309 | - cache('views' . DS . 'basics_test_2.cache', 'simple cache write 2'); |
|
310 | - $this->assertTrue(file_exists(CACHE . 'views' . DS . 'basics_test_2.cache')); |
|
309 | + cache('views'.DS.'basics_test_2.cache', 'simple cache write 2'); |
|
310 | + $this->assertTrue(file_exists(CACHE.'views'.DS.'basics_test_2.cache')); |
|
311 | 311 | |
312 | - cache('views' . DS . 'basics_test_3.cache', 'simple cache write 3'); |
|
313 | - $this->assertTrue(file_exists(CACHE . 'views' . DS . 'basics_test_3.cache')); |
|
312 | + cache('views'.DS.'basics_test_3.cache', 'simple cache write 3'); |
|
313 | + $this->assertTrue(file_exists(CACHE.'views'.DS.'basics_test_3.cache')); |
|
314 | 314 | |
315 | 315 | $result = clearCache(array('basics_test', 'basics_test_2'), 'views', '.cache'); |
316 | 316 | $this->assertTrue($result); |
317 | - $this->assertFalse(file_exists(CACHE . 'views' . DS . 'basics_test.cache')); |
|
318 | - $this->assertFalse(file_exists(CACHE . 'views' . DS . 'basics_test.cache')); |
|
319 | - $this->assertTrue(file_exists(CACHE . 'views' . DS . 'basics_test_3.cache')); |
|
317 | + $this->assertFalse(file_exists(CACHE.'views'.DS.'basics_test.cache')); |
|
318 | + $this->assertFalse(file_exists(CACHE.'views'.DS.'basics_test.cache')); |
|
319 | + $this->assertTrue(file_exists(CACHE.'views'.DS.'basics_test_3.cache')); |
|
320 | 320 | |
321 | 321 | $result = clearCache(null, 'views', '.cache'); |
322 | 322 | $this->assertTrue($result); |
323 | - $this->assertFalse(file_exists(CACHE . 'views' . DS . 'basics_test_3.cache')); |
|
323 | + $this->assertFalse(file_exists(CACHE.'views'.DS.'basics_test_3.cache')); |
|
324 | 324 | |
325 | 325 | // Different path from views and with prefix |
326 | - cache('models' . DS . 'basics_test.cache', 'simple cache write'); |
|
327 | - $this->assertTrue(file_exists(CACHE . 'models' . DS . 'basics_test.cache')); |
|
326 | + cache('models'.DS.'basics_test.cache', 'simple cache write'); |
|
327 | + $this->assertTrue(file_exists(CACHE.'models'.DS.'basics_test.cache')); |
|
328 | 328 | |
329 | - cache('models' . DS . 'basics_test_2.cache', 'simple cache write 2'); |
|
330 | - $this->assertTrue(file_exists(CACHE . 'models' . DS . 'basics_test_2.cache')); |
|
329 | + cache('models'.DS.'basics_test_2.cache', 'simple cache write 2'); |
|
330 | + $this->assertTrue(file_exists(CACHE.'models'.DS.'basics_test_2.cache')); |
|
331 | 331 | |
332 | - cache('models' . DS . 'basics_test_3.cache', 'simple cache write 3'); |
|
333 | - $this->assertTrue(file_exists(CACHE . 'models' . DS . 'basics_test_3.cache')); |
|
332 | + cache('models'.DS.'basics_test_3.cache', 'simple cache write 3'); |
|
333 | + $this->assertTrue(file_exists(CACHE.'models'.DS.'basics_test_3.cache')); |
|
334 | 334 | |
335 | 335 | $result = clearCache('basics', 'models', '.cache'); |
336 | 336 | $this->assertTrue($result); |
337 | - $this->assertFalse(file_exists(CACHE . 'models' . DS . 'basics_test.cache')); |
|
338 | - $this->assertFalse(file_exists(CACHE . 'models' . DS . 'basics_test_2.cache')); |
|
339 | - $this->assertFalse(file_exists(CACHE . 'models' . DS . 'basics_test_3.cache')); |
|
337 | + $this->assertFalse(file_exists(CACHE.'models'.DS.'basics_test.cache')); |
|
338 | + $this->assertFalse(file_exists(CACHE.'models'.DS.'basics_test_2.cache')); |
|
339 | + $this->assertFalse(file_exists(CACHE.'models'.DS.'basics_test_3.cache')); |
|
340 | 340 | |
341 | 341 | // checking if empty files were not removed |
342 | - $emptyExists = file_exists(CACHE . 'views' . DS . 'empty'); |
|
343 | - if (!$emptyExists) { |
|
344 | - cache('views' . DS . 'empty', ''); |
|
342 | + $emptyExists = file_exists(CACHE.'views'.DS.'empty'); |
|
343 | + if ( ! $emptyExists) { |
|
344 | + cache('views'.DS.'empty', ''); |
|
345 | 345 | } |
346 | - cache('views' . DS . 'basics_test.php', 'simple cache write'); |
|
347 | - $this->assertTrue(file_exists(CACHE . 'views' . DS . 'basics_test.php')); |
|
348 | - $this->assertTrue(file_exists(CACHE . 'views' . DS . 'empty')); |
|
346 | + cache('views'.DS.'basics_test.php', 'simple cache write'); |
|
347 | + $this->assertTrue(file_exists(CACHE.'views'.DS.'basics_test.php')); |
|
348 | + $this->assertTrue(file_exists(CACHE.'views'.DS.'empty')); |
|
349 | 349 | |
350 | 350 | $result = clearCache(); |
351 | 351 | $this->assertTrue($result); |
352 | - $this->assertTrue(file_exists(CACHE . 'views' . DS . 'empty')); |
|
353 | - $this->assertFalse(file_exists(CACHE . 'views' . DS . 'basics_test.php')); |
|
354 | - if (!$emptyExists) { |
|
355 | - unlink(CACHE . 'views' . DS . 'empty'); |
|
352 | + $this->assertTrue(file_exists(CACHE.'views'.DS.'empty')); |
|
353 | + $this->assertFalse(file_exists(CACHE.'views'.DS.'basics_test.php')); |
|
354 | + if ( ! $emptyExists) { |
|
355 | + unlink(CACHE.'views'.DS.'empty'); |
|
356 | 356 | } |
357 | 357 | } |
358 | 358 | |
@@ -605,8 +605,8 @@ discard block |
||
605 | 605 | * @return void |
606 | 606 | */ |
607 | 607 | public function testLogError() { |
608 | - if (file_exists(LOGS . 'error.log')) { |
|
609 | - unlink(LOGS . 'error.log'); |
|
608 | + if (file_exists(LOGS.'error.log')) { |
|
609 | + unlink(LOGS.'error.log'); |
|
610 | 610 | } |
611 | 611 | |
612 | 612 | // disable stderr output for this test |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | CakeLog::enable('stderr'); |
622 | 622 | } |
623 | 623 | |
624 | - $result = file_get_contents(LOGS . 'error.log'); |
|
624 | + $result = file_get_contents(LOGS.'error.log'); |
|
625 | 625 | $this->assertRegExp('/Error: Testing LogError\(\) basic function/', $result); |
626 | 626 | $this->assertNotRegExp("/Error: Testing with\nmulti-line\nstring/", $result); |
627 | 627 | $this->assertRegExp('/Error: Testing with multi-line string/', $result); |
@@ -633,19 +633,19 @@ discard block |
||
633 | 633 | * @return void |
634 | 634 | */ |
635 | 635 | public function testFileExistsInPath() { |
636 | - if (!function_exists('ini_set')) { |
|
636 | + if ( ! function_exists('ini_set')) { |
|
637 | 637 | $this->markTestSkipped('%s ini_set function not available'); |
638 | 638 | } |
639 | 639 | |
640 | 640 | $_includePath = ini_get('include_path'); |
641 | 641 | |
642 | - $path = TMP . 'basics_test'; |
|
643 | - $folder1 = $path . DS . 'folder1'; |
|
644 | - $folder2 = $path . DS . 'folder2'; |
|
645 | - $file1 = $path . DS . 'file1.php'; |
|
646 | - $file2 = $folder1 . DS . 'file2.php'; |
|
647 | - $file3 = $folder1 . DS . 'file3.php'; |
|
648 | - $file4 = $folder2 . DS . 'file4.php'; |
|
642 | + $path = TMP.'basics_test'; |
|
643 | + $folder1 = $path.DS.'folder1'; |
|
644 | + $folder2 = $path.DS.'folder2'; |
|
645 | + $file1 = $path.DS.'file1.php'; |
|
646 | + $file2 = $folder1.DS.'file2.php'; |
|
647 | + $file3 = $folder1.DS.'file3.php'; |
|
648 | + $file4 = $folder2.DS.'file4.php'; |
|
649 | 649 | |
650 | 650 | new Folder($path, true); |
651 | 651 | new Folder($folder1, true); |
@@ -655,11 +655,11 @@ discard block |
||
655 | 655 | touch($file3); |
656 | 656 | touch($file4); |
657 | 657 | |
658 | - ini_set('include_path', $path . PATH_SEPARATOR . $folder1); |
|
658 | + ini_set('include_path', $path.PATH_SEPARATOR.$folder1); |
|
659 | 659 | |
660 | 660 | $this->assertEquals(fileExistsInPath('file1.php'), $file1); |
661 | 661 | $this->assertEquals(fileExistsInPath('file2.php'), $file2); |
662 | - $this->assertEquals(fileExistsInPath('folder1' . DS . 'file2.php'), $file2); |
|
662 | + $this->assertEquals(fileExistsInPath('folder1'.DS.'file2.php'), $file2); |
|
663 | 663 | $this->assertEquals(fileExistsInPath($file2), $file2); |
664 | 664 | $this->assertEquals(fileExistsInPath('file3.php'), $file3); |
665 | 665 | $this->assertEquals(fileExistsInPath($file4), $file4); |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | ########################### |
705 | 705 | |
706 | 706 | EXPECTED; |
707 | - $expected = sprintf($expectedText, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 9); |
|
707 | + $expected = sprintf($expectedText, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ -9); |
|
708 | 708 | |
709 | 709 | $this->assertEquals($expected, $result); |
710 | 710 | |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | </pre> |
720 | 720 | </div> |
721 | 721 | EXPECTED; |
722 | - $expected = sprintf($expectedHtml, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 10); |
|
722 | + $expected = sprintf($expectedHtml, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ -10); |
|
723 | 723 | $this->assertEquals($expected, $result); |
724 | 724 | |
725 | 725 | ob_start(); |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | </pre> |
734 | 734 | </div> |
735 | 735 | EXPECTED; |
736 | - $expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 10); |
|
736 | + $expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ -10); |
|
737 | 737 | $this->assertEquals($expected, $result); |
738 | 738 | |
739 | 739 | ob_start(); |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | </pre> |
748 | 748 | </div> |
749 | 749 | EXPECTED; |
750 | - $expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 10); |
|
750 | + $expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ -10); |
|
751 | 751 | $this->assertEquals($expected, $result); |
752 | 752 | |
753 | 753 | ob_start(); |
@@ -769,9 +769,9 @@ discard block |
||
769 | 769 | |
770 | 770 | EXPECTED; |
771 | 771 | if (php_sapi_name() === 'cli') { |
772 | - $expected = sprintf($expectedText, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 18); |
|
772 | + $expected = sprintf($expectedText, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ -18); |
|
773 | 773 | } else { |
774 | - $expected = sprintf($expectedHtml, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 19); |
|
774 | + $expected = sprintf($expectedHtml, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ -19); |
|
775 | 775 | } |
776 | 776 | $this->assertEquals($expected, $result); |
777 | 777 | |
@@ -794,9 +794,9 @@ discard block |
||
794 | 794 | |
795 | 795 | EXPECTED; |
796 | 796 | if (php_sapi_name() === 'cli') { |
797 | - $expected = sprintf($expectedText, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 18); |
|
797 | + $expected = sprintf($expectedText, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ -18); |
|
798 | 798 | } else { |
799 | - $expected = sprintf($expectedHtml, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 19); |
|
799 | + $expected = sprintf($expectedHtml, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ -19); |
|
800 | 800 | } |
801 | 801 | $this->assertEquals($expected, $result); |
802 | 802 | |
@@ -810,7 +810,7 @@ discard block |
||
810 | 810 | ########################### |
811 | 811 | |
812 | 812 | EXPECTED; |
813 | - $expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 9); |
|
813 | + $expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ -9); |
|
814 | 814 | $this->assertEquals($expected, $result); |
815 | 815 | |
816 | 816 | ob_start(); |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | ########################### |
824 | 824 | |
825 | 825 | EXPECTED; |
826 | - $expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 9); |
|
826 | + $expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ -9); |
|
827 | 827 | $this->assertEquals($expected, $result); |
828 | 828 | |
829 | 829 | ob_start(); |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | ########################### |
837 | 837 | |
838 | 838 | EXPECTED; |
839 | - $expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 9); |
|
839 | + $expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ -9); |
|
840 | 840 | $this->assertEquals($expected, $result); |
841 | 841 | |
842 | 842 | ob_start(); |
@@ -849,7 +849,7 @@ discard block |
||
849 | 849 | ########################### |
850 | 850 | |
851 | 851 | EXPECTED; |
852 | - $expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 9); |
|
852 | + $expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ -9); |
|
853 | 853 | $this->assertEquals($expected, $result); |
854 | 854 | } |
855 | 855 | |
@@ -902,14 +902,14 @@ discard block |
||
902 | 902 | $this->skipIf(ini_get('magic_quotes_sybase') === '1', 'magic_quotes_sybase is on.'); |
903 | 903 | |
904 | 904 | $this->assertEquals(stripslashes_deep("tes\'t"), "tes't"); |
905 | - $this->assertEquals(stripslashes_deep('tes\\' . chr(0) . 't'), 'tes' . chr(0) . 't'); |
|
905 | + $this->assertEquals(stripslashes_deep('tes\\'.chr(0).'t'), 'tes'.chr(0).'t'); |
|
906 | 906 | $this->assertEquals(stripslashes_deep('tes\"t'), 'tes"t'); |
907 | 907 | $this->assertEquals(stripslashes_deep("tes\'t"), "tes't"); |
908 | 908 | $this->assertEquals(stripslashes_deep('te\\st'), 'test'); |
909 | 909 | |
910 | 910 | $nested = array( |
911 | 911 | 'a' => "tes\'t", |
912 | - 'b' => 'tes\\' . chr(0) . 't', |
|
912 | + 'b' => 'tes\\'.chr(0).'t', |
|
913 | 913 | 'c' => array( |
914 | 914 | 'd' => 'tes\"t', |
915 | 915 | 'e' => "te\'s\'t", |
@@ -919,7 +919,7 @@ discard block |
||
919 | 919 | ); |
920 | 920 | $expected = array( |
921 | 921 | 'a' => "tes't", |
922 | - 'b' => 'tes' . chr(0) . 't', |
|
922 | + 'b' => 'tes'.chr(0).'t', |
|
923 | 923 | 'c' => array( |
924 | 924 | 'd' => 'tes"t', |
925 | 925 | 'e' => "te's't", |
@@ -936,7 +936,7 @@ discard block |
||
936 | 936 | * @return void |
937 | 937 | */ |
938 | 938 | public function testStripslashesDeepSybase() { |
939 | - if (!(ini_get('magic_quotes_sybase') === '1')) { |
|
939 | + if ( ! (ini_get('magic_quotes_sybase') === '1')) { |
|
940 | 940 | $this->markTestSkipped('magic_quotes_sybase is off'); |
941 | 941 | } |
942 | 942 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | Configure::write('Cache.disable', false); |
37 | 37 | |
38 | 38 | $this->_defaultCacheConfig = Cache::config('default'); |
39 | - Cache::config('default', array('engine' => 'File', 'path' => TMP . 'tests')); |
|
39 | + Cache::config('default', array('engine' => 'File', 'path' => TMP.'tests')); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @return void |
60 | 60 | */ |
61 | 61 | public function testConfig() { |
62 | - $settings = array('engine' => 'File', 'path' => TMP . 'tests', 'prefix' => 'cake_test_'); |
|
62 | + $settings = array('engine' => 'File', 'path' => TMP.'tests', 'prefix' => 'cake_test_'); |
|
63 | 63 | $results = Cache::config('new', $settings); |
64 | 64 | $this->assertEquals(Cache::config('new'), $results); |
65 | 65 | $this->assertTrue(isset($results['engine'])); |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function testConfigWithLibAndPluginEngines() { |
103 | 103 | App::build(array( |
104 | - 'Lib' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS), |
|
105 | - 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS) |
|
104 | + 'Lib' => array(CAKE.'Test'.DS.'test_app'.DS.'Lib'.DS), |
|
105 | + 'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS) |
|
106 | 106 | ), App::RESET); |
107 | 107 | CakePlugin::load('TestPlugin'); |
108 | 108 | |
@@ -181,10 +181,10 @@ discard block |
||
181 | 181 | $_cacheConfigSessions = Cache::config('sessions'); |
182 | 182 | $_cacheConfigTests = Cache::config('tests'); |
183 | 183 | |
184 | - $result = Cache::config('sessions', array('engine' => 'File', 'path' => TMP . 'sessions')); |
|
184 | + $result = Cache::config('sessions', array('engine' => 'File', 'path' => TMP.'sessions')); |
|
185 | 185 | $this->assertEquals(Cache::settings('sessions'), $result['settings']); |
186 | 186 | |
187 | - $result = Cache::config('tests', array('engine' => 'File', 'path' => TMP . 'tests')); |
|
187 | + $result = Cache::config('tests', array('engine' => 'File', 'path' => TMP.'tests')); |
|
188 | 188 | $this->assertEquals(Cache::settings('tests'), $result['settings']); |
189 | 189 | |
190 | 190 | Cache::config('sessions', $_cacheConfigSessions['settings']); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | Cache::write('test_something', 'this is the test data', 'tests'); |
229 | 229 | |
230 | 230 | $expected = array( |
231 | - 'path' => TMP . 'sessions' . DS, |
|
231 | + 'path' => TMP.'sessions'.DS, |
|
232 | 232 | 'prefix' => 'cake_', |
233 | 233 | 'lock' => true, |
234 | 234 | 'serialize' => true, |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | */ |
329 | 329 | public function testInitSettings() { |
330 | 330 | $initial = Cache::settings(); |
331 | - $override = array('engine' => 'File', 'path' => TMP . 'tests'); |
|
331 | + $override = array('engine' => 'File', 'path' => TMP.'tests'); |
|
332 | 332 | Cache::config('for_test', $override); |
333 | 333 | |
334 | 334 | $settings = Cache::settings(); |
@@ -344,8 +344,8 @@ discard block |
||
344 | 344 | */ |
345 | 345 | public function testDrop() { |
346 | 346 | App::build(array( |
347 | - 'Lib' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS), |
|
348 | - 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS) |
|
347 | + 'Lib' => array(CAKE.'Test'.DS.'test_app'.DS.'Lib'.DS), |
|
348 | + 'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS) |
|
349 | 349 | ), App::RESET); |
350 | 350 | |
351 | 351 | $result = Cache::drop('some_config_that_does_not_exist'); |
@@ -396,8 +396,8 @@ discard block |
||
396 | 396 | */ |
397 | 397 | public function testWriteTriggerError() { |
398 | 398 | App::build(array( |
399 | - 'Lib' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS), |
|
400 | - 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS) |
|
399 | + 'Lib' => array(CAKE.'Test'.DS.'test_app'.DS.'Lib'.DS), |
|
400 | + 'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS) |
|
401 | 401 | ), App::RESET); |
402 | 402 | |
403 | 403 | Cache::config('test_trigger', array('engine' => 'TestAppCache', 'prefix' => '')); |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | */ |
422 | 422 | public function testCacheDisable() { |
423 | 423 | Configure::write('Cache.disable', false); |
424 | - Cache::config('test_cache_disable_1', array('engine' => 'File', 'path' => TMP . 'tests')); |
|
424 | + Cache::config('test_cache_disable_1', array('engine' => 'File', 'path' => TMP.'tests')); |
|
425 | 425 | |
426 | 426 | $this->assertTrue(Cache::write('key_1', 'hello', 'test_cache_disable_1')); |
427 | 427 | $this->assertSame(Cache::read('key_1', 'test_cache_disable_1'), 'hello'); |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | $this->assertSame(Cache::read('key_3', 'test_cache_disable_1'), 'hello'); |
438 | 438 | |
439 | 439 | Configure::write('Cache.disable', true); |
440 | - Cache::config('test_cache_disable_2', array('engine' => 'File', 'path' => TMP . 'tests')); |
|
440 | + Cache::config('test_cache_disable_2', array('engine' => 'File', 'path' => TMP.'tests')); |
|
441 | 441 | |
442 | 442 | $this->assertFalse(Cache::write('key_4', 'hello', 'test_cache_disable_2')); |
443 | 443 | $this->assertFalse(Cache::read('key_4', 'test_cache_disable_2')); |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function setUp() { |
34 | 34 | parent::setUp(); |
35 | - $this->skipIf(!function_exists('apc_store'), 'Apc is not installed or configured properly.'); |
|
35 | + $this->skipIf( ! function_exists('apc_store'), 'Apc is not installed or configured properly.'); |
|
36 | 36 | |
37 | 37 | if (php_sapi_name() === 'cli') { |
38 | - $this->skipIf(!ini_get('apc.enable_cli'), 'APC is not enabled for the CLI.'); |
|
38 | + $this->skipIf( ! ini_get('apc.enable_cli'), 'APC is not enabled for the CLI.'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $this->_cacheDisable = Configure::read('Cache.disable'); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * @return void |
148 | 148 | */ |
149 | 149 | public function testDecrement() { |
150 | - $this->skipIf(!function_exists('apc_dec'), 'No apc_dec() function, cannot test decrement().'); |
|
150 | + $this->skipIf( ! function_exists('apc_dec'), 'No apc_dec() function, cannot test decrement().'); |
|
151 | 151 | |
152 | 152 | $result = Cache::write('test_decrement', 5, 'apc'); |
153 | 153 | $this->assertTrue($result); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @return void |
172 | 172 | */ |
173 | 173 | public function testIncrement() { |
174 | - $this->skipIf(!function_exists('apc_inc'), 'No apc_inc() function, cannot test increment().'); |
|
174 | + $this->skipIf( ! function_exists('apc_inc'), 'No apc_inc() function, cannot test increment().'); |
|
175 | 175 | |
176 | 176 | $result = Cache::write('test_increment', 5, 'apc'); |
177 | 177 | $this->assertTrue($result); |