Merge branch 'master' into 2.6

This commit is contained in:
mark_story 2014-05-27 20:55:06 -04:00
commit 0c8406c034
4 changed files with 21 additions and 11 deletions

View file

@ -16,11 +16,17 @@ services:
- memcached
matrix:
fast_finish: true
allow_failures:
- php: 5.4
env:
- PHPCS=1
include:
- php: 5.4
env:
- PHPCS=1
before_script:
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then composer global require 'phpunit/phpunit=3.7.33'; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then ln -s ~/.composer/vendor/phpunit/phpunit/PHPUnit ./vendors/PHPUnit; fi"

View file

@ -127,7 +127,7 @@ class ExtractTask extends AppShell {
);
$response = $this->in($message, null, $defaultPath);
if (strtoupper($response) === 'Q') {
$this->out(__d('cake_console', 'Extract Aborted'));
$this->err(__d('cake_console', 'Extract Aborted'));
return $this->_stop();
} elseif (strtoupper($response) === 'D' && count($this->_paths)) {
$this->out();
@ -204,7 +204,7 @@ class ExtractTask extends AppShell {
while (true) {
$response = $this->in($message, null, rtrim($this->_paths[0], DS) . DS . 'Locale');
if (strtoupper($response) === 'Q') {
$this->out(__d('cake_console', 'Extract Aborted'));
$this->err(__d('cake_console', 'Extract Aborted'));
return $this->_stop();
} elseif ($this->_isPathUsable($response)) {
$this->_output = $response . DS;
@ -734,16 +734,16 @@ class ExtractTask extends AppShell {
* @return void
*/
protected function _markerError($file, $line, $marker, $count) {
$this->out(__d('cake_console', "Invalid marker content in %s:%s\n* %s(", $file, $line, $marker));
$this->err(__d('cake_console', "Invalid marker content in %s:%s\n* %s(", $file, $line, $marker));
$count += 2;
$tokenCount = count($this->_tokens);
$parenthesis = 1;
while ((($tokenCount - $count) > 0) && $parenthesis) {
if (is_array($this->_tokens[$count])) {
$this->out($this->_tokens[$count][1], false);
$this->err($this->_tokens[$count][1], false);
} else {
$this->out($this->_tokens[$count], false);
$this->err($this->_tokens[$count], false);
if ($this->_tokens[$count] === '(') {
$parenthesis++;
}
@ -754,7 +754,7 @@ class ExtractTask extends AppShell {
}
$count++;
}
$this->out("\n", true);
$this->err("\n", true);
}
/**

View file

@ -4939,7 +4939,7 @@ class FormHelperTest extends CakeTestCase {
*/
public function testSelectMultipleWithDisabledElements() {
$options = array(1 => 'One', 2 => 'Two', '3' => 'Three', '3x' => 'Stringy');
$disabled = array(2, 3);
$disabled = array(1);
$result = $this->Form->select('Contact.multiple', $options, array('multiple' => 'multiple', 'disabled' => $disabled));
$expected = array(
'input' => array(
@ -4948,13 +4948,13 @@ class FormHelperTest extends CakeTestCase {
'select' => array(
'name' => 'data[Contact][multiple][]', 'multiple' => 'multiple', 'id' => 'ContactMultiple'
),
array('option' => array('value' => '1')),
array('option' => array('value' => '1', 'disabled' => 'disabled')),
'One',
'/option',
array('option' => array('value' => '2', 'disabled' => 'disabled')),
array('option' => array('value' => '2')),
'Two',
'/option',
array('option' => array('value' => '3', 'disabled' => 'disabled')),
array('option' => array('value' => '3')),
'Three',
'/option',
array('option' => array('value' => '3x')),

View file

@ -2091,7 +2091,11 @@ class FormHelper extends AppHelper {
) {
$this->_secure(true, $this->_secureFieldName($attributes));
}
$select[] = $this->Html->useTag($tag, $attributes['name'], array_diff_key($attributes, array('name' => null, 'value' => null)));
$filter = array('name' => null, 'value' => null);
if (is_array($attributes['disabled'])) {
$filter['disabled'] = null;
}
$select[] = $this->Html->useTag($tag, $attributes['name'], array_diff_key($attributes, $filter));
}
$emptyMulti = (
$showEmpty !== null && $showEmpty !== false && !(