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 - memcached
matrix: matrix:
fast_finish: true
allow_failures:
- php: 5.4
env:
- PHPCS=1
include: include:
- php: 5.4 - php: 5.4
env: env:
- PHPCS=1 - PHPCS=1
before_script: 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 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" - 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); $response = $this->in($message, null, $defaultPath);
if (strtoupper($response) === 'Q') { if (strtoupper($response) === 'Q') {
$this->out(__d('cake_console', 'Extract Aborted')); $this->err(__d('cake_console', 'Extract Aborted'));
return $this->_stop(); return $this->_stop();
} elseif (strtoupper($response) === 'D' && count($this->_paths)) { } elseif (strtoupper($response) === 'D' && count($this->_paths)) {
$this->out(); $this->out();
@ -204,7 +204,7 @@ class ExtractTask extends AppShell {
while (true) { while (true) {
$response = $this->in($message, null, rtrim($this->_paths[0], DS) . DS . 'Locale'); $response = $this->in($message, null, rtrim($this->_paths[0], DS) . DS . 'Locale');
if (strtoupper($response) === 'Q') { if (strtoupper($response) === 'Q') {
$this->out(__d('cake_console', 'Extract Aborted')); $this->err(__d('cake_console', 'Extract Aborted'));
return $this->_stop(); return $this->_stop();
} elseif ($this->_isPathUsable($response)) { } elseif ($this->_isPathUsable($response)) {
$this->_output = $response . DS; $this->_output = $response . DS;
@ -734,16 +734,16 @@ class ExtractTask extends AppShell {
* @return void * @return void
*/ */
protected function _markerError($file, $line, $marker, $count) { 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; $count += 2;
$tokenCount = count($this->_tokens); $tokenCount = count($this->_tokens);
$parenthesis = 1; $parenthesis = 1;
while ((($tokenCount - $count) > 0) && $parenthesis) { while ((($tokenCount - $count) > 0) && $parenthesis) {
if (is_array($this->_tokens[$count])) { if (is_array($this->_tokens[$count])) {
$this->out($this->_tokens[$count][1], false); $this->err($this->_tokens[$count][1], false);
} else { } else {
$this->out($this->_tokens[$count], false); $this->err($this->_tokens[$count], false);
if ($this->_tokens[$count] === '(') { if ($this->_tokens[$count] === '(') {
$parenthesis++; $parenthesis++;
} }
@ -754,7 +754,7 @@ class ExtractTask extends AppShell {
} }
$count++; $count++;
} }
$this->out("\n", true); $this->err("\n", true);
} }
/** /**

View file

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

View file

@ -2091,7 +2091,11 @@ class FormHelper extends AppHelper {
) { ) {
$this->_secure(true, $this->_secureFieldName($attributes)); $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 = ( $emptyMulti = (
$showEmpty !== null && $showEmpty !== false && !( $showEmpty !== null && $showEmpty !== false && !(