Skip to content

Commit

Permalink
Fix code style errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Oct 9, 2012
1 parent 9a66768 commit 57681ff
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 31 deletions.
8 changes: 4 additions & 4 deletions lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php
Expand Up @@ -490,7 +490,7 @@ public function testRevoke() {
* @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'));
Expand Down Expand Up @@ -518,10 +518,10 @@ protected function __debug($printTreesToo = false) {
}
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()));
Expand All @@ -537,7 +537,7 @@ protected function __debug($printTreesToo = false) {
* @param integer $len
* @return void
*/
protected function __pad($string = '', $len = 14) {
protected function _pad($string = '', $len = 14) {
return str_pad($string, $len);
}
}
18 changes: 9 additions & 9 deletions lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php
Expand Up @@ -412,11 +412,11 @@ public function testReadingCookieDataOnStartup() {
$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',
Expand Down Expand Up @@ -467,11 +467,11 @@ public function testReadingCookieDataWithoutStartup() {
$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',
Expand Down Expand Up @@ -648,7 +648,7 @@ protected function _implode(array $array) {
* @param array|string $value
* @return string
*/
protected function __encrypt($value) {
protected function _encrypt($value) {
if (is_array($value)) {
$value = $this->_implode($value);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Core/AppTest.php
Expand Up @@ -749,7 +749,7 @@ public function testLoadingVendor() {
$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);
Expand Down
6 changes: 5 additions & 1 deletion lib/Cake/Test/Case/Log/CakeLogTest.php
Expand Up @@ -383,7 +383,11 @@ public function testScopedLoggingBC() {
CakeLog::drop('shops');
}


/**
* Test that scopes are exclusive and don't bleed.
*
* @return void
*/
public function testScopedLoggingExclusive() {
$this->_deleteLogs();

Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Network/CakeRequestTest.php
Expand Up @@ -1667,7 +1667,7 @@ public static function environmentGenerator() {
*/
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");
Expand Down Expand Up @@ -1965,7 +1965,7 @@ public function testOnlyAllowException() {
* @param array $env
* @return void
*/
protected function __loadEnvironment($env) {
protected function _loadEnvironment($env) {
if (isset($env['App'])) {
Configure::write('App', $env['App']);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Network/CakeResponseTest.php
Expand Up @@ -1040,7 +1040,7 @@ public function testFile() {

$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');
Expand All @@ -1054,7 +1054,7 @@ public function testFile() {
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);
}

Expand Down
12 changes: 6 additions & 6 deletions lib/Cake/Test/Case/Routing/DispatcherTest.php
Expand Up @@ -1574,7 +1574,7 @@ public function testFullPageCachingDispatch($url) {

$this->assertTextEquals($out, $cached);

$filename = $this->__cachePath($request->here());
$filename = $this->_cachePath($request->here());
unlink($filename);
}

Expand Down Expand Up @@ -1662,7 +1662,7 @@ public function testHttpMethodOverrides() {
*
* @return void
*/
protected function __backupEnvironment() {
protected function _backupEnvironment() {
return array(
'App' => Configure::read('App'),
'GET' => $_GET,
Expand All @@ -1676,7 +1676,7 @@ protected function __backupEnvironment() {
*
* @return void
*/
protected function __reloadEnvironment() {
protected function _reloadEnvironment() {
foreach ($_GET as $key => $val) {
unset($_GET[$key]);
}
Expand All @@ -1695,9 +1695,9 @@ protected function __reloadEnvironment() {
* @param array $env
* @return void
*/
protected function __loadEnvironment($env) {
protected function _loadEnvironment($env) {
if ($env['reload']) {
$this->__reloadEnvironment();
$this->_reloadEnvironment();
}

if (isset($env['App'])) {
Expand Down Expand Up @@ -1729,7 +1729,7 @@ protected function __loadEnvironment($env) {
* @param string $here
* @return string
*/
protected function __cachePath($here) {
protected function _cachePath($here) {
$path = $here;
if ($here == '/') {
$path = 'home';
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/View/MediaViewTest.php
Expand Up @@ -100,7 +100,7 @@ public function testRender() {

$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))
Expand All @@ -111,7 +111,7 @@ public function testRender() {
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);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/test_app/Vendor/css/test_asset.css
@@ -1 +1 @@
this is the test asset css file
/* this is the test asset css file */
@@ -1 +1 @@
this is the test asset css file
/* this is the test asset css file */
@@ -1 +1 @@
override the theme webroot css file
/* override the theme webroot css file */
@@ -1 +1 @@
this is the webroot test asset css file
/* this is the webroot test asset css file */

0 comments on commit 57681ff

Please sign in to comment.