Skip to content

Commit

Permalink
Merge branch '2.6' into 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jun 26, 2015
2 parents ab2f4c2 + 74c0e81 commit ae2ea1e
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 19 deletions.
3 changes: 3 additions & 0 deletions lib/Cake/Console/ShellDispatcher.php
Expand Up @@ -177,6 +177,9 @@ public function setErrorHandlers() {
}
set_exception_handler($exception['consoleHandler']);
set_error_handler($error['consoleHandler'], Configure::read('Error.level'));

App::uses('Debugger', 'Utility');
Debugger::getInstance()->output('txt');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/Database/Postgres.php
Expand Up @@ -98,7 +98,7 @@ class Postgres extends DboSource {
*
* @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.
Expand Down
5 changes: 5 additions & 0 deletions lib/Cake/Test/Case/Error/ErrorHandlerTest.php
Expand Up @@ -19,6 +19,7 @@
App::uses('ErrorHandler', 'Error');
App::uses('Controller', 'Controller');
App::uses('Router', 'Routing');
App::uses('Debugger', 'Utility');

/**
* A faulty ExceptionRenderer to test nesting.
Expand Down Expand Up @@ -92,6 +93,8 @@ public function testHandleErrorDebugOn() {
set_error_handler('ErrorHandler::handleError');
$this->_restoreError = true;

Debugger::getInstance()->output('html');

ob_start();
$wrong .= '';
$result = ob_get_clean();
Expand Down Expand Up @@ -123,6 +126,8 @@ public function testErrorMapping($error, $expected) {
set_error_handler('ErrorHandler::handleError');
$this->_restoreError = true;

Debugger::getInstance()->output('html');

ob_start();
trigger_error('Test error', $error);

Expand Down
4 changes: 4 additions & 0 deletions lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php
Expand Up @@ -490,6 +490,10 @@ public function testRegexpOperatorConditionsParsing() {
$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))
);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
Expand Up @@ -1602,7 +1602,7 @@ public function testSendRenderWithImage() {
$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();
$this->assertContains($expected, $result['message']);
}
Expand Down
1 change: 0 additions & 1 deletion lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
Expand Up @@ -1755,7 +1755,6 @@ public function testMeta() {

$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->assertRegExp('/\s+\/>$/', $result);

$result = $this->Html->meta('description', 'this is the meta description');
$this->assertTags($result, array('meta' => array('name' => 'description', 'content' => 'this is the meta description')));
Expand Down
10 changes: 5 additions & 5 deletions lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php
Expand Up @@ -2857,7 +2857,7 @@ public function testMetaPage1() {
'paramType' => 'querystring'
)
);
$expected = '<link href="/?page=2" rel="next" />';
$expected = '<link href="/?page=2" rel="next"/>';
$result = $this->Paginator->meta();
$this->assertSame($expected, $result);
}
Expand All @@ -2878,7 +2878,7 @@ public function testMetaPage1InlineFalse() {
'paramType' => 'querystring'
)
);
$expected = '<link href="/?page=2" rel="next" />';
$expected = '<link href="/?page=2" rel="next"/>';
$this->Paginator->meta(array('block' => true));
$result = $this->View->fetch('meta');
$this->assertSame($expected, $result);
Expand All @@ -2900,7 +2900,7 @@ public function testMetaPage1Last() {
'paramType' => 'querystring'
)
);
$expected = '<link href="/" rel="prev" />';
$expected = '<link href="/" rel="prev"/>';
$result = $this->Paginator->meta();
$this->assertSame($expected, $result);
}
Expand All @@ -2921,8 +2921,8 @@ public function testMetaPage10Last() {
'paramType' => 'querystring'
)
);
$expected = '<link href="/?page=4" rel="prev" />';
$expected .= '<link href="/?page=6" rel="next" />';
$expected = '<link href="/?page=4" rel="prev"/>';
$expected .= '<link href="/?page=6" rel="next"/>';
$result = $this->Paginator->meta();
$this->assertSame($expected, $result);
}
Expand Down
22 changes: 11 additions & 11 deletions lib/Cake/View/Helper/HtmlHelper.php
Expand Up @@ -279,12 +279,12 @@ public function meta($type, $url = null, $options = array()) {
if (isset($options['link'])) {
$options['link'] = $this->assetUrl($options['link']);
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';
}
$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 {
$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'])) {
Expand Down Expand Up @@ -565,7 +565,7 @@ public function script($url, $options = array()) {
$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);

if (empty($options['block'])) {
Expand Down Expand Up @@ -601,7 +601,7 @@ public function scriptBlock($script, $options = array()) {
}
unset($options['inline'], $options['safe']);

$attributes = $this->_parseAttributes($options, array('block'), ' ');
$attributes = $this->_parseAttributes($options, array('block'));
$out = sprintf($this->_tags['javascriptblock'], $attributes, $script);

if (empty($options['block'])) {
Expand Down Expand Up @@ -828,7 +828,7 @@ public function image($path, $options = array()) {
unset($options['url']);
}

$image = sprintf($this->_tags['image'], $path, $this->_parseAttributes($options, null, ' ', ' '));
$image = sprintf($this->_tags['image'], $path, $this->_parseAttributes($options));

if ($url) {
return sprintf($this->_tags['link'], $this->url($url), null, $image);
Expand Down Expand Up @@ -946,7 +946,7 @@ public function tag($name, $text = null, $options = array()) {
} else {
$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);
}

/**
Expand All @@ -964,7 +964,7 @@ public function useTag($tag) {
array_shift($args);
foreach ($args as &$arg) {
if (is_array($arg)) {
$arg = $this->_parseAttributes($arg, null, ' ', '');
$arg = $this->_parseAttributes($arg);
}
}
return vsprintf($this->_tags[$tag], $args);
Expand Down Expand Up @@ -1015,7 +1015,7 @@ public function para($class, $text, $options = array()) {
if ($text === null) {
$tag = 'parastart';
}
return sprintf($this->_tags[$tag], $this->_parseAttributes($options, null, ' ', ''), $text);
return sprintf($this->_tags[$tag], $this->_parseAttributes($options), $text);
}

/**
Expand Down Expand Up @@ -1151,7 +1151,7 @@ public function nestedList($list, $options = array(), $itemOptions = array(), $t
$options = array();
}
$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);
}

/**
Expand All @@ -1177,7 +1177,7 @@ protected function _nestedListItem($items, $options, $itemOptions, $tag) {
} elseif (isset($itemOptions['odd']) && $index % 2 !== 0) {
$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++;
}
return $out;
Expand Down

0 comments on commit ae2ea1e

Please sign in to comment.