Merge branch '2.6' into 2.7

This commit is contained in:
mark_story 2015-06-25 21:50:47 -04:00
commit ae2ea1ea6c
8 changed files with 30 additions and 19 deletions

View file

@ -177,6 +177,9 @@ class ShellDispatcher {
} }
set_exception_handler($exception['consoleHandler']); set_exception_handler($exception['consoleHandler']);
set_error_handler($error['consoleHandler'], Configure::read('Error.level')); set_error_handler($error['consoleHandler'], Configure::read('Error.level'));
App::uses('Debugger', 'Utility');
Debugger::getInstance()->output('txt');
} }
/** /**

View file

@ -98,7 +98,7 @@ class Postgres extends DboSource {
* *
* @var array * @var array
*/ */
protected $_sqlOps = array('like', 'ilike', 'or', 'not', 'in', 'between', '~', '~*', '!~', '!~*', 'similar to'); protected $_sqlOps = array('like', 'ilike', 'or', 'not', 'in', 'between', '~', '~\*', '\!~', '\!~\*', 'similar to');
/** /**
* Connects to the database using options in the given configuration array. * Connects to the database using options in the given configuration array.

View file

@ -19,6 +19,7 @@
App::uses('ErrorHandler', 'Error'); App::uses('ErrorHandler', 'Error');
App::uses('Controller', 'Controller'); App::uses('Controller', 'Controller');
App::uses('Router', 'Routing'); App::uses('Router', 'Routing');
App::uses('Debugger', 'Utility');
/** /**
* A faulty ExceptionRenderer to test nesting. * A faulty ExceptionRenderer to test nesting.
@ -92,6 +93,8 @@ class ErrorHandlerTest extends CakeTestCase {
set_error_handler('ErrorHandler::handleError'); set_error_handler('ErrorHandler::handleError');
$this->_restoreError = true; $this->_restoreError = true;
Debugger::getInstance()->output('html');
ob_start(); ob_start();
$wrong .= ''; $wrong .= '';
$result = ob_get_clean(); $result = ob_get_clean();
@ -123,6 +126,8 @@ class ErrorHandlerTest extends CakeTestCase {
set_error_handler('ErrorHandler::handleError'); set_error_handler('ErrorHandler::handleError');
$this->_restoreError = true; $this->_restoreError = true;
Debugger::getInstance()->output('html');
ob_start(); ob_start();
trigger_error('Test error', $error); trigger_error('Test error', $error);

View file

@ -490,6 +490,10 @@ class PostgresTest extends CakeTestCase {
$this->assertSame(' WHERE "name" ~* \'[a-z_]+\'', $this->Dbo->conditions(array('name ~*' => '[a-z_]+'))); $this->assertSame(' WHERE "name" ~* \'[a-z_]+\'', $this->Dbo->conditions(array('name ~*' => '[a-z_]+')));
$this->assertSame(' WHERE "name" !~ \'[a-z_]+\'', $this->Dbo->conditions(array('name !~' => '[a-z_]+'))); $this->assertSame(' WHERE "name" !~ \'[a-z_]+\'', $this->Dbo->conditions(array('name !~' => '[a-z_]+')));
$this->assertSame(' WHERE "name" !~* \'[a-z_]+\'', $this->Dbo->conditions(array('name !~*' => '[a-z_]+'))); $this->assertSame(' WHERE "name" !~* \'[a-z_]+\'', $this->Dbo->conditions(array('name !~*' => '[a-z_]+')));
$this->assertSame(
' WHERE EXTRACT( \'YEAR\' FROM "User"."birthday" ) = 2015',
$this->Dbo->conditions(array('EXTRACT( \'YEAR\' FROM User.birthday )' => 2015))
);
} }
/** /**

View file

@ -1602,7 +1602,7 @@ class CakeEmailTest extends CakeTestCase {
$server .= ':' . env('SERVER_PORT'); $server .= ':' . env('SERVER_PORT');
} }
$expected = '<img src="http://' . $server . '/img/image.gif" alt="cool image" width="100" height="100" />'; $expected = '<img src="http://' . $server . '/img/image.gif" alt="cool image" width="100" height="100"/>';
$result = $this->CakeEmail->send(); $result = $this->CakeEmail->send();
$this->assertContains($expected, $result['message']); $this->assertContains($expected, $result['message']);
} }

View file

@ -1755,7 +1755,6 @@ class HtmlHelperTest extends CakeTestCase {
$result = $this->Html->meta('keywords', 'these, are, some, meta, keywords'); $result = $this->Html->meta('keywords', 'these, are, some, meta, keywords');
$this->assertTags($result, array('meta' => array('name' => 'keywords', 'content' => 'these, are, some, meta, keywords'))); $this->assertTags($result, array('meta' => array('name' => 'keywords', 'content' => 'these, are, some, meta, keywords')));
$this->assertRegExp('/\s+\/>$/', $result);
$result = $this->Html->meta('description', 'this is the meta description'); $result = $this->Html->meta('description', 'this is the meta description');
$this->assertTags($result, array('meta' => array('name' => 'description', 'content' => 'this is the meta description'))); $this->assertTags($result, array('meta' => array('name' => 'description', 'content' => 'this is the meta description')));

View file

@ -2857,7 +2857,7 @@ class PaginatorHelperTest extends CakeTestCase {
'paramType' => 'querystring' 'paramType' => 'querystring'
) )
); );
$expected = '<link href="/?page=2" rel="next" />'; $expected = '<link href="/?page=2" rel="next"/>';
$result = $this->Paginator->meta(); $result = $this->Paginator->meta();
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
} }
@ -2878,7 +2878,7 @@ class PaginatorHelperTest extends CakeTestCase {
'paramType' => 'querystring' 'paramType' => 'querystring'
) )
); );
$expected = '<link href="/?page=2" rel="next" />'; $expected = '<link href="/?page=2" rel="next"/>';
$this->Paginator->meta(array('block' => true)); $this->Paginator->meta(array('block' => true));
$result = $this->View->fetch('meta'); $result = $this->View->fetch('meta');
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
@ -2900,7 +2900,7 @@ class PaginatorHelperTest extends CakeTestCase {
'paramType' => 'querystring' 'paramType' => 'querystring'
) )
); );
$expected = '<link href="/" rel="prev" />'; $expected = '<link href="/" rel="prev"/>';
$result = $this->Paginator->meta(); $result = $this->Paginator->meta();
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
} }
@ -2921,8 +2921,8 @@ class PaginatorHelperTest extends CakeTestCase {
'paramType' => 'querystring' 'paramType' => 'querystring'
) )
); );
$expected = '<link href="/?page=4" rel="prev" />'; $expected = '<link href="/?page=4" rel="prev"/>';
$expected .= '<link href="/?page=6" rel="next" />'; $expected .= '<link href="/?page=6" rel="next"/>';
$result = $this->Paginator->meta(); $result = $this->Paginator->meta();
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
} }

View file

@ -279,12 +279,12 @@ class HtmlHelper extends AppHelper {
if (isset($options['link'])) { if (isset($options['link'])) {
$options['link'] = $this->assetUrl($options['link']); $options['link'] = $this->assetUrl($options['link']);
if (isset($options['rel']) && $options['rel'] === 'icon') { if (isset($options['rel']) && $options['rel'] === 'icon') {
$out = sprintf($this->_tags['metalink'], $options['link'], $this->_parseAttributes($options, array('block', 'link'), ' ', ' ')); $out = sprintf($this->_tags['metalink'], $options['link'], $this->_parseAttributes($options, array('block', 'link')));
$options['rel'] = 'shortcut icon'; $options['rel'] = 'shortcut icon';
} }
$out .= sprintf($this->_tags['metalink'], $options['link'], $this->_parseAttributes($options, array('block', 'link'), ' ', ' ')); $out .= sprintf($this->_tags['metalink'], $options['link'], $this->_parseAttributes($options, array('block', 'link')));
} else { } else {
$out = sprintf($this->_tags['meta'], $this->_parseAttributes($options, array('block', 'type'), ' ', ' ')); $out = sprintf($this->_tags['meta'], $this->_parseAttributes($options, array('block', 'type')));
} }
if (empty($options['block'])) { if (empty($options['block'])) {
@ -565,7 +565,7 @@ class HtmlHelper extends AppHelper {
$url = str_replace(Configure::read('App.jsBaseUrl'), 'cjs/', $url); $url = str_replace(Configure::read('App.jsBaseUrl'), 'cjs/', $url);
} }
} }
$attributes = $this->_parseAttributes($options, array('block', 'once'), ' '); $attributes = $this->_parseAttributes($options, array('block', 'once'));
$out = sprintf($this->_tags['javascriptlink'], $url, $attributes); $out = sprintf($this->_tags['javascriptlink'], $url, $attributes);
if (empty($options['block'])) { if (empty($options['block'])) {
@ -601,7 +601,7 @@ class HtmlHelper extends AppHelper {
} }
unset($options['inline'], $options['safe']); unset($options['inline'], $options['safe']);
$attributes = $this->_parseAttributes($options, array('block'), ' '); $attributes = $this->_parseAttributes($options, array('block'));
$out = sprintf($this->_tags['javascriptblock'], $attributes, $script); $out = sprintf($this->_tags['javascriptblock'], $attributes, $script);
if (empty($options['block'])) { if (empty($options['block'])) {
@ -828,7 +828,7 @@ class HtmlHelper extends AppHelper {
unset($options['url']); unset($options['url']);
} }
$image = sprintf($this->_tags['image'], $path, $this->_parseAttributes($options, null, ' ', ' ')); $image = sprintf($this->_tags['image'], $path, $this->_parseAttributes($options));
if ($url) { if ($url) {
return sprintf($this->_tags['link'], $this->url($url), null, $image); return sprintf($this->_tags['link'], $this->url($url), null, $image);
@ -946,7 +946,7 @@ class HtmlHelper extends AppHelper {
} else { } else {
$tag = 'tag'; $tag = 'tag';
} }
return sprintf($this->_tags[$tag], $name, $this->_parseAttributes($options, null, ' ', ''), $text, $name); return sprintf($this->_tags[$tag], $name, $this->_parseAttributes($options), $text, $name);
} }
/** /**
@ -964,7 +964,7 @@ class HtmlHelper extends AppHelper {
array_shift($args); array_shift($args);
foreach ($args as &$arg) { foreach ($args as &$arg) {
if (is_array($arg)) { if (is_array($arg)) {
$arg = $this->_parseAttributes($arg, null, ' ', ''); $arg = $this->_parseAttributes($arg);
} }
} }
return vsprintf($this->_tags[$tag], $args); return vsprintf($this->_tags[$tag], $args);
@ -1015,7 +1015,7 @@ class HtmlHelper extends AppHelper {
if ($text === null) { if ($text === null) {
$tag = 'parastart'; $tag = 'parastart';
} }
return sprintf($this->_tags[$tag], $this->_parseAttributes($options, null, ' ', ''), $text); return sprintf($this->_tags[$tag], $this->_parseAttributes($options), $text);
} }
/** /**
@ -1151,7 +1151,7 @@ class HtmlHelper extends AppHelper {
$options = array(); $options = array();
} }
$items = $this->_nestedListItem($list, $options, $itemOptions, $tag); $items = $this->_nestedListItem($list, $options, $itemOptions, $tag);
return sprintf($this->_tags[$tag], $this->_parseAttributes($options, null, ' ', ''), $items); return sprintf($this->_tags[$tag], $this->_parseAttributes($options), $items);
} }
/** /**
@ -1177,7 +1177,7 @@ class HtmlHelper extends AppHelper {
} elseif (isset($itemOptions['odd']) && $index % 2 !== 0) { } elseif (isset($itemOptions['odd']) && $index % 2 !== 0) {
$itemOptions['class'] = $itemOptions['odd']; $itemOptions['class'] = $itemOptions['odd'];
} }
$out .= sprintf($this->_tags['li'], $this->_parseAttributes($itemOptions, array('even', 'odd'), ' ', ''), $item); $out .= sprintf($this->_tags['li'], $this->_parseAttributes($itemOptions, array('even', 'odd')), $item);
$index++; $index++;
} }
return $out; return $out;