mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fix code style errors.
This commit is contained in:
parent
9a66768aa4
commit
57681ff115
12 changed files with 35 additions and 31 deletions
|
@ -490,7 +490,7 @@ class DbAclTest extends CakeTestCase {
|
||||||
* @param bool $treesToo
|
* @param bool $treesToo
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function __debug($printTreesToo = false) {
|
protected function _debug($printTreesToo = false) {
|
||||||
$this->Acl->Aro->displayField = 'alias';
|
$this->Acl->Aro->displayField = 'alias';
|
||||||
$this->Acl->Aco->displayField = 'alias';
|
$this->Acl->Aco->displayField = 'alias';
|
||||||
$aros = $this->Acl->Aro->find('list', array('order' => 'lft'));
|
$aros = $this->Acl->Aro->find('list', array('order' => 'lft'));
|
||||||
|
@ -518,10 +518,10 @@ class DbAclTest extends CakeTestCase {
|
||||||
}
|
}
|
||||||
foreach ($permissions as $key => $values) {
|
foreach ($permissions as $key => $values) {
|
||||||
array_unshift($values, $key);
|
array_unshift($values, $key);
|
||||||
$values = array_map(array(&$this, '__pad'), $values);
|
$values = array_map(array(&$this, '_pad'), $values);
|
||||||
$permissions[$key] = implode (' ', $values);
|
$permissions[$key] = implode (' ', $values);
|
||||||
}
|
}
|
||||||
$permisssions = array_map(array(&$this, '__pad'), $permissions);
|
$permisssions = array_map(array(&$this, '_pad'), $permissions);
|
||||||
array_unshift($permissions, 'Current Permissions :');
|
array_unshift($permissions, 'Current Permissions :');
|
||||||
if ($printTreesToo) {
|
if ($printTreesToo) {
|
||||||
debug(array('aros' => $this->Acl->Aro->generateTreeList(), 'acos' => $this->Acl->Aco->generateTreeList()));
|
debug(array('aros' => $this->Acl->Aro->generateTreeList(), 'acos' => $this->Acl->Aco->generateTreeList()));
|
||||||
|
@ -537,7 +537,7 @@ class DbAclTest extends CakeTestCase {
|
||||||
* @param integer $len
|
* @param integer $len
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function __pad($string = '', $len = 14) {
|
protected function _pad($string = '', $len = 14) {
|
||||||
return str_pad($string, $len);
|
return str_pad($string, $len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -412,11 +412,11 @@ class CookieComponentTest extends CakeTestCase {
|
||||||
$this->assertNull($data);
|
$this->assertNull($data);
|
||||||
|
|
||||||
$_COOKIE['CakeTestCookie'] = array(
|
$_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(
|
'Encrytped_multi_cookies' => array(
|
||||||
'name' => $this->__encrypt('CakePHP'),
|
'name' => $this->_encrypt('CakePHP'),
|
||||||
'version' => $this->__encrypt('1.2.0.x'),
|
'version' => $this->_encrypt('1.2.0.x'),
|
||||||
'tag' => $this->__encrypt('CakePHP Rocks!')),
|
'tag' => $this->_encrypt('CakePHP Rocks!')),
|
||||||
'Plain_array' => '{"name":"CakePHP","version":"1.2.0.x","tag":"CakePHP Rocks!"}',
|
'Plain_array' => '{"name":"CakePHP","version":"1.2.0.x","tag":"CakePHP Rocks!"}',
|
||||||
'Plain_multi_cookies' => array(
|
'Plain_multi_cookies' => array(
|
||||||
'name' => 'CakePHP',
|
'name' => 'CakePHP',
|
||||||
|
@ -467,11 +467,11 @@ class CookieComponentTest extends CakeTestCase {
|
||||||
$this->assertEquals($expected, $data);
|
$this->assertEquals($expected, $data);
|
||||||
|
|
||||||
$_COOKIE['CakeTestCookie'] = array(
|
$_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(
|
'Encrytped_multi_cookies' => array(
|
||||||
'name' => $this->__encrypt('CakePHP'),
|
'name' => $this->_encrypt('CakePHP'),
|
||||||
'version' => $this->__encrypt('1.2.0.x'),
|
'version' => $this->_encrypt('1.2.0.x'),
|
||||||
'tag' => $this->__encrypt('CakePHP Rocks!')),
|
'tag' => $this->_encrypt('CakePHP Rocks!')),
|
||||||
'Plain_array' => '{"name":"CakePHP","version":"1.2.0.x","tag":"CakePHP Rocks!"}',
|
'Plain_array' => '{"name":"CakePHP","version":"1.2.0.x","tag":"CakePHP Rocks!"}',
|
||||||
'Plain_multi_cookies' => array(
|
'Plain_multi_cookies' => array(
|
||||||
'name' => 'CakePHP',
|
'name' => 'CakePHP',
|
||||||
|
@ -648,7 +648,7 @@ class CookieComponentTest extends CakeTestCase {
|
||||||
* @param array|string $value
|
* @param array|string $value
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function __encrypt($value) {
|
protected function _encrypt($value) {
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
$value = $this->_implode($value);
|
$value = $this->_implode($value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -749,7 +749,7 @@ class AppTest extends CakeTestCase {
|
||||||
$result = App::import('Vendor', 'css/TestAsset', array('ext' => 'css'));
|
$result = App::import('Vendor', 'css/TestAsset', array('ext' => 'css'));
|
||||||
$text = ob_get_clean();
|
$text = ob_get_clean();
|
||||||
$this->assertTrue($result);
|
$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');
|
$result = App::import('Vendor', 'TestPlugin.sample/SamplePlugin');
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
|
|
|
@ -383,7 +383,11 @@ class CakeLogTest extends CakeTestCase {
|
||||||
CakeLog::drop('shops');
|
CakeLog::drop('shops');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that scopes are exclusive and don't bleed.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function testScopedLoggingExclusive() {
|
public function testScopedLoggingExclusive() {
|
||||||
$this->_deleteLogs();
|
$this->_deleteLogs();
|
||||||
|
|
||||||
|
|
|
@ -1667,7 +1667,7 @@ class CakeRequestTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testEnvironmentDetection($name, $env, $expected) {
|
public function testEnvironmentDetection($name, $env, $expected) {
|
||||||
$_GET = array();
|
$_GET = array();
|
||||||
$this->__loadEnvironment($env);
|
$this->_loadEnvironment($env);
|
||||||
|
|
||||||
$request = new CakeRequest();
|
$request = new CakeRequest();
|
||||||
$this->assertEquals($expected['url'], $request->url, "url error");
|
$this->assertEquals($expected['url'], $request->url, "url error");
|
||||||
|
@ -1965,7 +1965,7 @@ XML;
|
||||||
* @param array $env
|
* @param array $env
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function __loadEnvironment($env) {
|
protected function _loadEnvironment($env) {
|
||||||
if (isset($env['App'])) {
|
if (isset($env['App'])) {
|
||||||
Configure::write('App', $env['App']);
|
Configure::write('App', $env['App']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1040,7 +1040,7 @@ class CakeResponseTest extends CakeTestCase {
|
||||||
|
|
||||||
$response->expects($this->at(1))
|
$response->expects($this->at(1))
|
||||||
->method('header')
|
->method('header')
|
||||||
->with('Content-Length', 31);
|
->with('Content-Length', 38);
|
||||||
|
|
||||||
$response->expects($this->once())->method('_clearBuffer');
|
$response->expects($this->once())->method('_clearBuffer');
|
||||||
$response->expects($this->once())->method('_flushBuffer');
|
$response->expects($this->once())->method('_flushBuffer');
|
||||||
|
@ -1054,7 +1054,7 @@ class CakeResponseTest extends CakeTestCase {
|
||||||
ob_start();
|
ob_start();
|
||||||
$result = $response->send();
|
$result = $response->send();
|
||||||
$output = ob_get_clean();
|
$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);
|
$this->assertTrue($result !== false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1574,7 +1574,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
|
|
||||||
$this->assertTextEquals($out, $cached);
|
$this->assertTextEquals($out, $cached);
|
||||||
|
|
||||||
$filename = $this->__cachePath($request->here());
|
$filename = $this->_cachePath($request->here());
|
||||||
unlink($filename);
|
unlink($filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1662,7 +1662,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function __backupEnvironment() {
|
protected function _backupEnvironment() {
|
||||||
return array(
|
return array(
|
||||||
'App' => Configure::read('App'),
|
'App' => Configure::read('App'),
|
||||||
'GET' => $_GET,
|
'GET' => $_GET,
|
||||||
|
@ -1676,7 +1676,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function __reloadEnvironment() {
|
protected function _reloadEnvironment() {
|
||||||
foreach ($_GET as $key => $val) {
|
foreach ($_GET as $key => $val) {
|
||||||
unset($_GET[$key]);
|
unset($_GET[$key]);
|
||||||
}
|
}
|
||||||
|
@ -1695,9 +1695,9 @@ class DispatcherTest extends CakeTestCase {
|
||||||
* @param array $env
|
* @param array $env
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function __loadEnvironment($env) {
|
protected function _loadEnvironment($env) {
|
||||||
if ($env['reload']) {
|
if ($env['reload']) {
|
||||||
$this->__reloadEnvironment();
|
$this->_reloadEnvironment();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($env['App'])) {
|
if (isset($env['App'])) {
|
||||||
|
@ -1729,7 +1729,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
* @param string $here
|
* @param string $here
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function __cachePath($here) {
|
protected function _cachePath($here) {
|
||||||
$path = $here;
|
$path = $here;
|
||||||
if ($here == '/') {
|
if ($here == '/') {
|
||||||
$path = 'home';
|
$path = 'home';
|
||||||
|
|
|
@ -100,7 +100,7 @@ class MediaViewTest extends CakeTestCase {
|
||||||
|
|
||||||
$this->MediaView->response->expects($this->at(2))
|
$this->MediaView->response->expects($this->at(2))
|
||||||
->method('header')
|
->method('header')
|
||||||
->with('Content-Length', 31);
|
->with('Content-Length', 38);
|
||||||
|
|
||||||
$this->MediaView->response->expects($this->once())->method('_clearBuffer');
|
$this->MediaView->response->expects($this->once())->method('_clearBuffer');
|
||||||
$this->MediaView->response->expects($this->exactly(1))
|
$this->MediaView->response->expects($this->exactly(1))
|
||||||
|
@ -111,7 +111,7 @@ class MediaViewTest extends CakeTestCase {
|
||||||
ob_start();
|
ob_start();
|
||||||
$result = $this->MediaView->render();
|
$result = $this->MediaView->render();
|
||||||
$output = ob_get_clean();
|
$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);
|
$this->assertTrue($result !== false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
Loading…
Reference in a new issue