From 57681ff11567043b1871e0df63c1727fee0d7569 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 9 Oct 2012 12:35:21 -0400 Subject: [PATCH] Fix code style errors. --- .../Controller/Component/Acl/DbAclTest.php | 8 ++++---- .../Component/CookieComponentTest.php | 18 +++++++++--------- lib/Cake/Test/Case/Core/AppTest.php | 2 +- lib/Cake/Test/Case/Log/CakeLogTest.php | 6 +++++- lib/Cake/Test/Case/Network/CakeRequestTest.php | 4 ++-- .../Test/Case/Network/CakeResponseTest.php | 4 ++-- lib/Cake/Test/Case/Routing/DispatcherTest.php | 12 ++++++------ lib/Cake/Test/Case/View/MediaViewTest.php | 4 ++-- .../Test/test_app/Vendor/css/test_asset.css | 2 +- .../TestTheme/webroot/css/test_asset.css | 2 +- .../theme/test_theme/css/theme_webroot.css | 2 +- .../theme/test_theme/css/webroot_test.css | 2 +- 12 files changed, 35 insertions(+), 31 deletions(-) diff --git a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php index bfc33f68a..84d9f8fce 100644 --- a/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php @@ -490,7 +490,7 @@ class DbAclTest extends CakeTestCase { * @param bool $treesToo * @return void */ - protected function __debug($printTreesToo = false) { + protected function _debug($printTreesToo = false) { $this->Acl->Aro->displayField = 'alias'; $this->Acl->Aco->displayField = 'alias'; $aros = $this->Acl->Aro->find('list', array('order' => 'lft')); @@ -518,10 +518,10 @@ class DbAclTest extends CakeTestCase { } foreach ($permissions as $key => $values) { array_unshift($values, $key); - $values = array_map(array(&$this, '__pad'), $values); + $values = array_map(array(&$this, '_pad'), $values); $permissions[$key] = implode (' ', $values); } - $permisssions = array_map(array(&$this, '__pad'), $permissions); + $permisssions = array_map(array(&$this, '_pad'), $permissions); array_unshift($permissions, 'Current Permissions :'); if ($printTreesToo) { debug(array('aros' => $this->Acl->Aro->generateTreeList(), 'acos' => $this->Acl->Aco->generateTreeList())); @@ -537,7 +537,7 @@ class DbAclTest extends CakeTestCase { * @param integer $len * @return void */ - protected function __pad($string = '', $len = 14) { + protected function _pad($string = '', $len = 14) { return str_pad($string, $len); } } diff --git a/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php b/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php index e001df5e5..67e0e397f 100644 --- a/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php @@ -412,11 +412,11 @@ class CookieComponentTest extends CakeTestCase { $this->assertNull($data); $_COOKIE['CakeTestCookie'] = array( - 'Encrytped_array' => $this->__encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')), + 'Encrytped_array' => $this->_encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')), 'Encrytped_multi_cookies' => array( - 'name' => $this->__encrypt('CakePHP'), - 'version' => $this->__encrypt('1.2.0.x'), - 'tag' => $this->__encrypt('CakePHP Rocks!')), + 'name' => $this->_encrypt('CakePHP'), + 'version' => $this->_encrypt('1.2.0.x'), + 'tag' => $this->_encrypt('CakePHP Rocks!')), 'Plain_array' => '{"name":"CakePHP","version":"1.2.0.x","tag":"CakePHP Rocks!"}', 'Plain_multi_cookies' => array( 'name' => 'CakePHP', @@ -467,11 +467,11 @@ class CookieComponentTest extends CakeTestCase { $this->assertEquals($expected, $data); $_COOKIE['CakeTestCookie'] = array( - 'Encrytped_array' => $this->__encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')), + 'Encrytped_array' => $this->_encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')), 'Encrytped_multi_cookies' => array( - 'name' => $this->__encrypt('CakePHP'), - 'version' => $this->__encrypt('1.2.0.x'), - 'tag' => $this->__encrypt('CakePHP Rocks!')), + 'name' => $this->_encrypt('CakePHP'), + 'version' => $this->_encrypt('1.2.0.x'), + 'tag' => $this->_encrypt('CakePHP Rocks!')), 'Plain_array' => '{"name":"CakePHP","version":"1.2.0.x","tag":"CakePHP Rocks!"}', 'Plain_multi_cookies' => array( 'name' => 'CakePHP', @@ -648,7 +648,7 @@ class CookieComponentTest extends CakeTestCase { * @param array|string $value * @return string */ - protected function __encrypt($value) { + protected function _encrypt($value) { if (is_array($value)) { $value = $this->_implode($value); } diff --git a/lib/Cake/Test/Case/Core/AppTest.php b/lib/Cake/Test/Case/Core/AppTest.php index e355ec0ba..23d0f5d71 100644 --- a/lib/Cake/Test/Case/Core/AppTest.php +++ b/lib/Cake/Test/Case/Core/AppTest.php @@ -749,7 +749,7 @@ class AppTest extends CakeTestCase { $result = App::import('Vendor', 'css/TestAsset', array('ext' => 'css')); $text = ob_get_clean(); $this->assertTrue($result); - $this->assertEquals('this is the test asset css file', $text); + $this->assertEquals('/* this is the test asset css file */', trim($text)); $result = App::import('Vendor', 'TestPlugin.sample/SamplePlugin'); $this->assertTrue($result); diff --git a/lib/Cake/Test/Case/Log/CakeLogTest.php b/lib/Cake/Test/Case/Log/CakeLogTest.php index e54f2c71a..b442d24bb 100644 --- a/lib/Cake/Test/Case/Log/CakeLogTest.php +++ b/lib/Cake/Test/Case/Log/CakeLogTest.php @@ -383,7 +383,11 @@ class CakeLogTest extends CakeTestCase { CakeLog::drop('shops'); } - +/** + * Test that scopes are exclusive and don't bleed. + * + * @return void + */ public function testScopedLoggingExclusive() { $this->_deleteLogs(); diff --git a/lib/Cake/Test/Case/Network/CakeRequestTest.php b/lib/Cake/Test/Case/Network/CakeRequestTest.php index 981a2c044..c1e294582 100644 --- a/lib/Cake/Test/Case/Network/CakeRequestTest.php +++ b/lib/Cake/Test/Case/Network/CakeRequestTest.php @@ -1667,7 +1667,7 @@ class CakeRequestTest extends CakeTestCase { */ public function testEnvironmentDetection($name, $env, $expected) { $_GET = array(); - $this->__loadEnvironment($env); + $this->_loadEnvironment($env); $request = new CakeRequest(); $this->assertEquals($expected['url'], $request->url, "url error"); @@ -1965,7 +1965,7 @@ XML; * @param array $env * @return void */ - protected function __loadEnvironment($env) { + protected function _loadEnvironment($env) { if (isset($env['App'])) { Configure::write('App', $env['App']); } diff --git a/lib/Cake/Test/Case/Network/CakeResponseTest.php b/lib/Cake/Test/Case/Network/CakeResponseTest.php index d3253ddd2..5446c0f96 100644 --- a/lib/Cake/Test/Case/Network/CakeResponseTest.php +++ b/lib/Cake/Test/Case/Network/CakeResponseTest.php @@ -1040,7 +1040,7 @@ class CakeResponseTest extends CakeTestCase { $response->expects($this->at(1)) ->method('header') - ->with('Content-Length', 31); + ->with('Content-Length', 38); $response->expects($this->once())->method('_clearBuffer'); $response->expects($this->once())->method('_flushBuffer'); @@ -1054,7 +1054,7 @@ class CakeResponseTest extends CakeTestCase { ob_start(); $result = $response->send(); $output = ob_get_clean(); - $this->assertEquals('this is the test asset css file', $output); + $this->assertEquals("/* this is the test asset css file */\n", $output); $this->assertTrue($result !== false); } diff --git a/lib/Cake/Test/Case/Routing/DispatcherTest.php b/lib/Cake/Test/Case/Routing/DispatcherTest.php index a0e3df7ba..3ef32bfcd 100644 --- a/lib/Cake/Test/Case/Routing/DispatcherTest.php +++ b/lib/Cake/Test/Case/Routing/DispatcherTest.php @@ -1574,7 +1574,7 @@ class DispatcherTest extends CakeTestCase { $this->assertTextEquals($out, $cached); - $filename = $this->__cachePath($request->here()); + $filename = $this->_cachePath($request->here()); unlink($filename); } @@ -1662,7 +1662,7 @@ class DispatcherTest extends CakeTestCase { * * @return void */ - protected function __backupEnvironment() { + protected function _backupEnvironment() { return array( 'App' => Configure::read('App'), 'GET' => $_GET, @@ -1676,7 +1676,7 @@ class DispatcherTest extends CakeTestCase { * * @return void */ - protected function __reloadEnvironment() { + protected function _reloadEnvironment() { foreach ($_GET as $key => $val) { unset($_GET[$key]); } @@ -1695,9 +1695,9 @@ class DispatcherTest extends CakeTestCase { * @param array $env * @return void */ - protected function __loadEnvironment($env) { + protected function _loadEnvironment($env) { if ($env['reload']) { - $this->__reloadEnvironment(); + $this->_reloadEnvironment(); } if (isset($env['App'])) { @@ -1729,7 +1729,7 @@ class DispatcherTest extends CakeTestCase { * @param string $here * @return string */ - protected function __cachePath($here) { + protected function _cachePath($here) { $path = $here; if ($here == '/') { $path = 'home'; diff --git a/lib/Cake/Test/Case/View/MediaViewTest.php b/lib/Cake/Test/Case/View/MediaViewTest.php index 4f9c1348e..49d9dc80f 100644 --- a/lib/Cake/Test/Case/View/MediaViewTest.php +++ b/lib/Cake/Test/Case/View/MediaViewTest.php @@ -100,7 +100,7 @@ class MediaViewTest extends CakeTestCase { $this->MediaView->response->expects($this->at(2)) ->method('header') - ->with('Content-Length', 31); + ->with('Content-Length', 38); $this->MediaView->response->expects($this->once())->method('_clearBuffer'); $this->MediaView->response->expects($this->exactly(1)) @@ -111,7 +111,7 @@ class MediaViewTest extends CakeTestCase { ob_start(); $result = $this->MediaView->render(); $output = ob_get_clean(); - $this->assertEquals('this is the test asset css file', $output); + $this->assertEquals("/* this is the test asset css file */\n", $output); $this->assertTrue($result !== false); } diff --git a/lib/Cake/Test/test_app/Vendor/css/test_asset.css b/lib/Cake/Test/test_app/Vendor/css/test_asset.css index e8b09dd29..faf08b4d8 100644 --- a/lib/Cake/Test/test_app/Vendor/css/test_asset.css +++ b/lib/Cake/Test/test_app/Vendor/css/test_asset.css @@ -1 +1 @@ -this is the test asset css file \ No newline at end of file +/* this is the test asset css file */ diff --git a/lib/Cake/Test/test_app/View/Themed/TestTheme/webroot/css/test_asset.css b/lib/Cake/Test/test_app/View/Themed/TestTheme/webroot/css/test_asset.css index e8b09dd29..faf08b4d8 100644 --- a/lib/Cake/Test/test_app/View/Themed/TestTheme/webroot/css/test_asset.css +++ b/lib/Cake/Test/test_app/View/Themed/TestTheme/webroot/css/test_asset.css @@ -1 +1 @@ -this is the test asset css file \ No newline at end of file +/* this is the test asset css file */ diff --git a/lib/Cake/Test/test_app/webroot/theme/test_theme/css/theme_webroot.css b/lib/Cake/Test/test_app/webroot/theme/test_theme/css/theme_webroot.css index f65d3e08a..78e752b0f 100644 --- a/lib/Cake/Test/test_app/webroot/theme/test_theme/css/theme_webroot.css +++ b/lib/Cake/Test/test_app/webroot/theme/test_theme/css/theme_webroot.css @@ -1 +1 @@ -override the theme webroot css file \ No newline at end of file +/* override the theme webroot css file */ diff --git a/lib/Cake/Test/test_app/webroot/theme/test_theme/css/webroot_test.css b/lib/Cake/Test/test_app/webroot/theme/test_theme/css/webroot_test.css index 83c3bc4d7..f4fd4c3c4 100644 --- a/lib/Cake/Test/test_app/webroot/theme/test_theme/css/webroot_test.css +++ b/lib/Cake/Test/test_app/webroot/theme/test_theme/css/webroot_test.css @@ -1 +1 @@ -this is the webroot test asset css file \ No newline at end of file +/* this is the webroot test asset css file */