Skip to content
This repository
Browse code

Fix code style errors.

  • Loading branch information...
commit 57681ff11567043b1871e0df63c1727fee0d7569 1 parent 9a66768
Mark Story authored
8  lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php
@@ -490,7 +490,7 @@ public function testRevoke() {
490 490
  * @param bool $treesToo
491 491
  * @return void
492 492
  */
493  
-	protected function __debug($printTreesToo = false) {
  493
+	protected function _debug($printTreesToo = false) {
494 494
 		$this->Acl->Aro->displayField = 'alias';
495 495
 		$this->Acl->Aco->displayField = 'alias';
496 496
 		$aros = $this->Acl->Aro->find('list', array('order' => 'lft'));
@@ -518,10 +518,10 @@ protected function __debug($printTreesToo = false) {
518 518
 		}
519 519
 		foreach ($permissions as $key => $values) {
520 520
 			array_unshift($values, $key);
521  
-			$values = array_map(array(&$this, '__pad'), $values);
  521
+			$values = array_map(array(&$this, '_pad'), $values);
522 522
 			$permissions[$key] = implode (' ', $values);
523 523
 		}
524  
-		$permisssions = array_map(array(&$this, '__pad'), $permissions);
  524
+		$permisssions = array_map(array(&$this, '_pad'), $permissions);
525 525
 		array_unshift($permissions, 'Current Permissions :');
526 526
 		if ($printTreesToo) {
527 527
 			debug(array('aros' => $this->Acl->Aro->generateTreeList(), 'acos' => $this->Acl->Aco->generateTreeList()));
@@ -537,7 +537,7 @@ protected function __debug($printTreesToo = false) {
537 537
  * @param integer $len
538 538
  * @return void
539 539
  */
540  
-	protected function __pad($string = '', $len = 14) {
  540
+	protected function _pad($string = '', $len = 14) {
541 541
 		return str_pad($string, $len);
542 542
 	}
543 543
 }
18  lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php
@@ -412,11 +412,11 @@ public function testReadingCookieDataOnStartup() {
412 412
 		$this->assertNull($data);
413 413
 
414 414
 		$_COOKIE['CakeTestCookie'] = array(
415  
-				'Encrytped_array' => $this->__encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')),
  415
+				'Encrytped_array' => $this->_encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')),
416 416
 				'Encrytped_multi_cookies' => array(
417  
-						'name' => $this->__encrypt('CakePHP'),
418  
-						'version' => $this->__encrypt('1.2.0.x'),
419  
-						'tag' => $this->__encrypt('CakePHP Rocks!')),
  417
+						'name' => $this->_encrypt('CakePHP'),
  418
+						'version' => $this->_encrypt('1.2.0.x'),
  419
+						'tag' => $this->_encrypt('CakePHP Rocks!')),
420 420
 				'Plain_array' => '{"name":"CakePHP","version":"1.2.0.x","tag":"CakePHP Rocks!"}',
421 421
 				'Plain_multi_cookies' => array(
422 422
 						'name' => 'CakePHP',
@@ -467,11 +467,11 @@ public function testReadingCookieDataWithoutStartup() {
467 467
 		$this->assertEquals($expected, $data);
468 468
 
469 469
 		$_COOKIE['CakeTestCookie'] = array(
470  
-				'Encrytped_array' => $this->__encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')),
  470
+				'Encrytped_array' => $this->_encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')),
471 471
 				'Encrytped_multi_cookies' => array(
472  
-						'name' => $this->__encrypt('CakePHP'),
473  
-						'version' => $this->__encrypt('1.2.0.x'),
474  
-						'tag' => $this->__encrypt('CakePHP Rocks!')),
  472
+						'name' => $this->_encrypt('CakePHP'),
  473
+						'version' => $this->_encrypt('1.2.0.x'),
  474
+						'tag' => $this->_encrypt('CakePHP Rocks!')),
475 475
 				'Plain_array' => '{"name":"CakePHP","version":"1.2.0.x","tag":"CakePHP Rocks!"}',
476 476
 				'Plain_multi_cookies' => array(
477 477
 						'name' => 'CakePHP',
@@ -648,7 +648,7 @@ protected function _implode(array $array) {
648 648
  * @param array|string $value
649 649
  * @return string
650 650
  */
651  
-	protected function __encrypt($value) {
  651
+	protected function _encrypt($value) {
652 652
 		if (is_array($value)) {
653 653
 			$value = $this->_implode($value);
654 654
 		}
2  lib/Cake/Test/Case/Core/AppTest.php
@@ -749,7 +749,7 @@ public function testLoadingVendor() {
749 749
 		$result = App::import('Vendor', 'css/TestAsset', array('ext' => 'css'));
750 750
 		$text = ob_get_clean();
751 751
 		$this->assertTrue($result);
752  
-		$this->assertEquals('this is the test asset css file', $text);
  752
+		$this->assertEquals('/* this is the test asset css file */', trim($text));
753 753
 
754 754
 		$result = App::import('Vendor', 'TestPlugin.sample/SamplePlugin');
755 755
 		$this->assertTrue($result);
6  lib/Cake/Test/Case/Log/CakeLogTest.php
@@ -383,7 +383,11 @@ public function testScopedLoggingBC() {
383 383
 		CakeLog::drop('shops');
384 384
 	}
385 385
 
386  
-
  386
+/**
  387
+ * Test that scopes are exclusive and don't bleed.
  388
+ *
  389
+ * @return void
  390
+ */
387 391
 	public function testScopedLoggingExclusive() {
388 392
 		$this->_deleteLogs();
389 393
 
4  lib/Cake/Test/Case/Network/CakeRequestTest.php
@@ -1667,7 +1667,7 @@ public static function environmentGenerator() {
1667 1667
  */
1668 1668
 	public function testEnvironmentDetection($name, $env, $expected) {
1669 1669
 		$_GET = array();
1670  
-		$this->__loadEnvironment($env);
  1670
+		$this->_loadEnvironment($env);
1671 1671
 
1672 1672
 		$request = new CakeRequest();
1673 1673
 		$this->assertEquals($expected['url'], $request->url, "url error");
@@ -1965,7 +1965,7 @@ public function testOnlyAllowException() {
1965 1965
  * @param array $env
1966 1966
  * @return void
1967 1967
  */
1968  
-	protected function __loadEnvironment($env) {
  1968
+	protected function _loadEnvironment($env) {
1969 1969
 		if (isset($env['App'])) {
1970 1970
 			Configure::write('App', $env['App']);
1971 1971
 		}
4  lib/Cake/Test/Case/Network/CakeResponseTest.php
@@ -1040,7 +1040,7 @@ public function testFile() {
1040 1040
 
1041 1041
 		$response->expects($this->at(1))
1042 1042
 			->method('header')
1043  
-			->with('Content-Length', 31);
  1043
+			->with('Content-Length', 38);
1044 1044
 
1045 1045
 		$response->expects($this->once())->method('_clearBuffer');
1046 1046
 		$response->expects($this->once())->method('_flushBuffer');
@@ -1054,7 +1054,7 @@ public function testFile() {
1054 1054
 		ob_start();
1055 1055
 		$result = $response->send();
1056 1056
 		$output = ob_get_clean();
1057  
-		$this->assertEquals('this is the test asset css file', $output);
  1057
+		$this->assertEquals("/* this is the test asset css file */\n", $output);
1058 1058
 		$this->assertTrue($result !== false);
1059 1059
 	}
1060 1060
 
12  lib/Cake/Test/Case/Routing/DispatcherTest.php
@@ -1574,7 +1574,7 @@ public function testFullPageCachingDispatch($url) {
1574 1574
 
1575 1575
 		$this->assertTextEquals($out, $cached);
1576 1576
 
1577  
-		$filename = $this->__cachePath($request->here());
  1577
+		$filename = $this->_cachePath($request->here());
1578 1578
 		unlink($filename);
1579 1579
 	}
1580 1580
 
@@ -1662,7 +1662,7 @@ public function testHttpMethodOverrides() {
1662 1662
  *
1663 1663
  * @return void
1664 1664
  */
1665  
-	protected function __backupEnvironment() {
  1665
+	protected function _backupEnvironment() {
1666 1666
 		return array(
1667 1667
 			'App' => Configure::read('App'),
1668 1668
 			'GET' => $_GET,
@@ -1676,7 +1676,7 @@ protected function __backupEnvironment() {
1676 1676
  *
1677 1677
  * @return void
1678 1678
  */
1679  
-	protected function __reloadEnvironment() {
  1679
+	protected function _reloadEnvironment() {
1680 1680
 		foreach ($_GET as $key => $val) {
1681 1681
 			unset($_GET[$key]);
1682 1682
 		}
@@ -1695,9 +1695,9 @@ protected function __reloadEnvironment() {
1695 1695
  * @param array $env
1696 1696
  * @return void
1697 1697
  */
1698  
-	protected function __loadEnvironment($env) {
  1698
+	protected function _loadEnvironment($env) {
1699 1699
 		if ($env['reload']) {
1700  
-			$this->__reloadEnvironment();
  1700
+			$this->_reloadEnvironment();
1701 1701
 		}
1702 1702
 
1703 1703
 		if (isset($env['App'])) {
@@ -1729,7 +1729,7 @@ protected function __loadEnvironment($env) {
1729 1729
  * @param string $here
1730 1730
  * @return string
1731 1731
  */
1732  
-	protected function __cachePath($here) {
  1732
+	protected function _cachePath($here) {
1733 1733
 		$path = $here;
1734 1734
 		if ($here == '/') {
1735 1735
 			$path = 'home';
4  lib/Cake/Test/Case/View/MediaViewTest.php
@@ -100,7 +100,7 @@ public function testRender() {
100 100
 
101 101
 		$this->MediaView->response->expects($this->at(2))
102 102
 			->method('header')
103  
-			->with('Content-Length', 31);
  103
+			->with('Content-Length', 38);
104 104
 
105 105
 		$this->MediaView->response->expects($this->once())->method('_clearBuffer');
106 106
 		$this->MediaView->response->expects($this->exactly(1))
@@ -111,7 +111,7 @@ public function testRender() {
111 111
 		ob_start();
112 112
 		$result = $this->MediaView->render();
113 113
 		$output = ob_get_clean();
114  
-		$this->assertEquals('this is the test asset css file', $output);
  114
+		$this->assertEquals("/* this is the test asset css file */\n", $output);
115 115
 		$this->assertTrue($result !== false);
116 116
 	}
117 117
 
2  lib/Cake/Test/test_app/Vendor/css/test_asset.css
... ...
@@ -1 +1 @@
1  
-this is the test asset css file
  1
+/* this is the test asset css file */
2  lib/Cake/Test/test_app/View/Themed/TestTheme/webroot/css/test_asset.css
... ...
@@ -1 +1 @@
1  
-this is the test asset css file
  1
+/* this is the test asset css file */
2  lib/Cake/Test/test_app/webroot/theme/test_theme/css/theme_webroot.css
... ...
@@ -1 +1 @@
1  
-override the theme webroot css file
  1
+/* override the theme webroot css file */
2  lib/Cake/Test/test_app/webroot/theme/test_theme/css/webroot_test.css
... ...
@@ -1 +1 @@
1  
-this is the webroot test asset css file
  1
+/* this is the webroot test asset css file */

0 notes on commit 57681ff

Please sign in to comment.
Something went wrong with that request. Please try again.