Skip to content
Permalink
Browse files

CS fixes

  • Loading branch information...
dereuromark committed May 17, 2013
1 parent de7535d commit 97c2cb367dedcde219d74e93cf144bbec016f2d4
@@ -404,15 +404,15 @@ public function getPrefix() {
}
if ($this->interactive) {
$this->hr();
$this->out(__d('cake_console', 'You need to enable Configure::write(\'Routing.prefixes\',array(\'admin\')) in /app/Config/core.php to use prefix routing.'));
$this->out(__d('cake_console', 'You need to enable Configure::write(\'Routing.prefixes\', array(\'admin\')) in /app/Config/core.php to use prefix routing.'));
$this->out(__d('cake_console', 'What would you like the prefix route to be?'));
$this->out(__d('cake_console', 'Example: www.example.com/admin/controller'));
while (!$admin) {
$admin = $this->in(__d('cake_console', 'Enter a routing prefix:'), null, 'admin');
}
if ($this->cakeAdmin($admin) !== true) {
$this->out(__d('cake_console', '<error>Unable to write to</error> /app/Config/core.php.'));
$this->out(__d('cake_console', 'You need to enable Configure::write(\'Routing.prefixes\',array(\'admin\')) in /app/Config/core.php to use prefix routing.'));
$this->out(__d('cake_console', 'You need to enable Configure::write(\'Routing.prefixes\', array(\'admin\')) in /app/Config/core.php to use prefix routing.'));
$this->_stop();
}
return $admin . '_';
@@ -590,7 +590,7 @@ protected function _parseLiteralValue($string) {
$string = $string[1];
if (substr($string, 0, 2) === $this->_escape . 'x') {
$delimiter = $this->_escape . 'x';
return implode('', array_map('chr', array_map('hexdec',array_filter(explode($delimiter, $string)))));
return implode('', array_map('chr', array_map('hexdec', array_filter(explode($delimiter, $string)))));
}
if (substr($string, 0, 2) === $this->_escape . 'd') {
$delimiter = $this->_escape . 'd';
@@ -1046,7 +1046,7 @@ public function testRemove() {
array($modelClass => array('name' => '1.2')));
$this->assertEquals($children, $expects);
$topNodes = $this->Tree->children(false, true,array('name'));
$topNodes = $this->Tree->children(false, true, array('name'));
$expects = array(array($modelClass => array('name' => '1. Root')),
array($modelClass => array('name' => '1.1')));
$this->assertEquals($topNodes, $expects);
@@ -1077,7 +1077,7 @@ public function testRemoveLastTopParent() {
$this->assertEquals($initialCount, $laterCount);
$this->assertEquals($initialTopNodes, $laterTopNodes);
$topNodes = $this->Tree->children(false, true,array('name'));
$topNodes = $this->Tree->children(false, true, array('name'));
$expects = array(array($modelClass => array('name' => '1.1')),
array($modelClass => array('name' => '1.2')),
array($modelClass => array('name' => '1. Root')));
@@ -1148,7 +1148,7 @@ public function testRemoveAndDelete() {
);
$this->assertEquals($children, $expects);
$topNodes = $this->Tree->children(false, true,array('name'));
$topNodes = $this->Tree->children(false, true, array('name'));
$expects = array(array($modelClass => array('name' => '1. Root')));
$this->assertEquals($topNodes, $expects);
@@ -232,7 +232,7 @@ public function testGroupBy() {
array('Product' => array('type' => 'Music'), array('price' => 4)),
array('Product' => array('type' => 'Toy'), array('price' => 3))
);
$result = $Product->find('all',array(
$result = $Product->find('all', array(
'fields' => array('Product.type', 'MIN(Product.price) as price'),
'group' => 'Product.type',
'order' => 'Product.type ASC'
@@ -7717,34 +7717,34 @@ public function testVirtualFields() {
$this->assertFalse((bool)$result['Author']['false']);
}
$result = $Post->find('first',array('fields' => array('author_id')));
$result = $Post->find('first', array('fields' => array('author_id')));
$this->assertFalse(isset($result['Post']['two']));
$this->assertFalse(isset($result['Author']['false']));
$result = $Post->find('first',array('fields' => array('author_id', 'two')));
$result = $Post->find('first', array('fields' => array('author_id', 'two')));
$this->assertEquals(2, $result['Post']['two']);
$this->assertFalse(isset($result['Author']['false']));
$result = $Post->find('first',array('fields' => array('two')));
$result = $Post->find('first', array('fields' => array('two')));
$this->assertEquals(2, $result['Post']['two']);
$Post->id = 1;
$result = $Post->field('two');
$this->assertEquals(2, $result);
$result = $Post->find('first',array(
$result = $Post->find('first', array(
'conditions' => array('two' => 2),
'limit' => 1
));
$this->assertEquals(2, $result['Post']['two']);
$result = $Post->find('first',array(
$result = $Post->find('first', array(
'conditions' => array('two <' => 3),
'limit' => 1
));
$this->assertEquals(2, $result['Post']['two']);
$result = $Post->find('first',array(
$result = $Post->find('first', array(
'conditions' => array('NOT' => array('two >' => 3)),
'limit' => 1
));
@@ -396,7 +396,7 @@ public function testCounterCacheUpdated() {
$data[$Post->alias]['user_id'] = 301;
$Post->save($data);
$users = $User->find('all',array('order' => 'User.id'));
$users = $User->find('all', array('order' => 'User.id'));
$this->assertEquals(1, $users[0]['User']['post_count']);
$this->assertEquals(2, $users[1]['User']['post_count']);
}
@@ -423,7 +423,7 @@ public function testCounterCacheWithNonstandardPrimaryKey() {
$data[$Post->alias]['uid'] = 301;
$Post->save($data);
$users = $User->find('all',array('order' => 'User.uid'));
$users = $User->find('all', array('order' => 'User.uid'));
$this->assertEquals(1, $users[0]['User']['post_count']);
$this->assertEquals(2, $users[1]['User']['post_count']);
}
@@ -551,7 +551,7 @@ public function testCounterCacheMultipleCaches() {
));
$data[$Post->alias]['user_id'] = 301;
$Post->save($data);
$result = $User->find('all',array('order' => 'User.id'));
$result = $User->find('all', array('order' => 'User.id'));
$this->assertEquals(2, $result[0]['User']['post_count']);
$this->assertEquals(1, $result[1]['User']['posts_published']);
}
@@ -1076,7 +1076,7 @@ public function testAuth() {
'pass' => 'hunter2'
)
));
$this->assertEquals($socket->request['auth'],array('Basic' => array('user' => 'joel', 'pass' => 'hunter2')));
$this->assertEquals($socket->request['auth'], array('Basic' => array('user' => 'joel', 'pass' => 'hunter2')));
$this->assertTrue(strpos($socket->request['header'], 'Authorization: Basic am9lbDpodW50ZXIy') !== false);
}
@@ -282,15 +282,15 @@ public function testSort() {
$this->assertEquals($a, $b);
$a = array(
array(7,6,4),
array(3,4,5),
array(3,2,array(1,1,1)),
array(7, 6, 4),
array(3, 4, 5),
array(3, 2, array(1, 1, 1)),
);
$b = array(
array(3,2,array(1,1,1)),
array(3,4,5),
array(7,6,4),
array(3, 2, array(1, 1, 1)),
array(3, 4, 5),
array(7, 6, 4),
);
$a = Set::sort($a, '{n}', 'asc');
@@ -3472,10 +3472,10 @@ public function testInputErrorEscape() {
$this->Form->create('ValidateProfile');
$ValidateProfile = ClassRegistry::getObject('ValidateProfile');
$ValidateProfile->validationErrors['city'] = array('required<br>');
$result = $this->Form->input('city',array('error' => array('attributes' => array('escape' => true))));
$result = $this->Form->input('city', array('error' => array('attributes' => array('escape' => true))));
$this->assertRegExp('/required&lt;br&gt;/', $result);
$result = $this->Form->input('city',array('error' => array('attributes' => array('escape' => false))));
$result = $this->Form->input('city', array('error' => array('attributes' => array('escape' => false))));
$this->assertRegExp('/required<br>/', $result);
}
@@ -8428,7 +8428,7 @@ public function testMultiRecordForm() {
);
$this->assertTags($result, $expected);
$result = $this->Form->input('ValidateProfile.1.ValidateItem.2.created',array('empty' => true));
$result = $this->Form->input('ValidateProfile.1.ValidateItem.2.created', array('empty' => true));
$expected = array(
'div' => array('class' => 'input date'),
'label' => array('for' => 'ValidateProfile1ValidateItem2CreatedMonth'),

0 comments on commit 97c2cb3

Please sign in to comment.
You can’t perform that action at this time.