Merge branch '1.3' into integration

Conflicts:
	app/config/core.php
	cake/console/libs/acl.php
	cake/console/templates/skel/config/core.php
	cake/console/templates/skel/webroot/test.php
	cake/dispatcher.php
	cake/libs/view/errors/missing_action.ctp
	cake/libs/view/helpers/form.php
	cake/tests/cases/libs/cache/memcache.test.php
	cake/tests/cases/libs/controller/controller.test.php
	cake/tests/cases/libs/log/file_log.test.php
	cake/tests/cases/libs/model/cake_schema.test.php
	cake/tests/cases/libs/router.test.php
	cake/tests/cases/libs/view/helpers/ajax.test.php
	cake/tests/groups/bake.group.php
	cake/tests/groups/behaviors.group.php
	cake/tests/groups/i18n.group.php
	cake/tests/groups/javascript.group.php
	cake/tests/lib/reporter/cake_cli_reporter.php
This commit is contained in:
Mark Story 2010-10-31 21:56:59 -04:00
commit 08e7bcb7ab
81 changed files with 491 additions and 203 deletions

View file

@ -121,7 +121,8 @@
* - `Session.name` - The name of the cookie to use. Defaults to 'CAKEPHP'
* - `Session.timeout` - The number of minutes you want sessions to live for. This timeout is handled by CakePHP
* - `Session.cookieTimeout` - The number of minutes you want session cookies to live for.
* - `Session.checkAgent` - Do you want the user agent to be checked when starting sessions?
* - `Session.checkAgent` - Do you want the user agent to be checked when starting sessions? You might want to set the
* value to false, when dealing with older versions of IE, Chrome Frame or certain web-browsing devices and AJAX
* - `Session.defaults` - The default configuration set to use as a basis for your session.
* There are four builtins: php, cake, cache, database.
* - `Session.handler` - Can be used to enable a custom session handler. Expects an array of of callables,

View file

@ -18,6 +18,7 @@
// @license MIT License (http://www.opensource.org/licenses/mit-license.php)
// +--------------------------------------------------------------------------------------------+ //
////////////////////////////////////////////////////////////////////////////////////////////////////
1.3.4
1.3.5

View file

@ -17,4 +17,4 @@
* @since CakePHP(tm) v 1.1.11.4062
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
return $config['Cake.version'] = '1.3.4';
return $config['Cake.version'] = '1.3.5';

View file

@ -410,36 +410,36 @@ class AclShell extends Shell {
"\t" . __("see help for the 'create' command."),
'getpath' => "getPath aro|aco <node>\n" .
"\t" . __("Returns the path to the ACL object specified by <node>. This command") . "\n" .
"\t" . __("is useful in determining the inhertiance of permissions for a certain") . "\n" .
"\t" . __("object in the tree.") . "\n" .
"\t" . __("For more detailed parameter usage info,") . "\n" .
"\t" . __("see help for the 'create' command."),
"\t" . __("Returns the path to the ACL object specified by <node>. This command", true) . "\n" .
"\t" . __("is useful in determining the inhertiance of permissions for a certain", true) . "\n" .
"\t" . __("object in the tree.", true) . "\n" .
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
"\t" . __("see help for the 'create' command.", true),
'check' => "check <node> <node> [<aco_action>] " . __("or") . " all\n" .
"\t" . __("Use this command to check ACL permissions.") . "\n" .
"\t" . __("For more detailed parameter usage info,") . "\n" .
"\t" . __("see help for the 'create' command."),
'check' => "check <node> <node> [<aco_action>] " . __("or", true) . " all\n" .
"\t" . __("Use this command to check ACL permissions.", true) . "\n" .
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
"\t" . __("see help for the 'create' command.", true),
'grant' => "grant <node> <node> [<aco_action>] " . __("or") . " all\n" .
"\t" . __("Use this command to grant ACL permissions. Once executed, the ARO") . "\n" .
"\t" . __("specified (and its children, if any) will have ALLOW access to the") . "\n" .
"\t" . __("specified ACO action (and the ACO's children, if any).") . "\n" .
"\t" . __("For more detailed parameter usage info,") . "\n" .
"\t" . __("see help for the 'create' command."),
'grant' => "grant <aronode> <aconode> [<aco_action>] " . __("or", true) . " all\n" .
"\t" . __("Use this command to grant ACL permissions. Once executed, the ARO", true) . "\n" .
"\t" . __("specified (and its children, if any) will have ALLOW access to the", true) . "\n" .
"\t" . __("specified ACO action (and the ACO's children, if any).", true) . "\n" .
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
"\t" . __("see help for the 'create' command.", true),
'deny' => "deny <node> <node> [<aco_action>]" . __("or") . " all\n" .
"\t" . __("Use this command to deny ACL permissions. Once executed, the ARO") . "\n" .
"\t" . __("specified (and its children, if any) will have DENY access to the") . "\n" .
"\t" . __("specified ACO action (and the ACO's children, if any).") . "\n" .
"\t" . __("For more detailed parameter usage info,") . "\n" .
"\t" . __("see help for the 'create' command."),
'deny' => "deny <aronode> <aconode> [<aco_action>]" . __("or", true) . " all\n" .
"\t" . __("Use this command to deny ACL permissions. Once executed, the ARO", true) . "\n" .
"\t" . __("specified (and its children, if any) will have DENY access to the", true) . "\n" .
"\t" . __("specified ACO action (and the ACO's children, if any).", true) . "\n" .
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
"\t" . __("see help for the 'create' command.", true),
'inherit' => "inherit <node> <node> [<aco_action>]" . __("or") . " all\n" .
"\t" . __("Use this command to force a child ARO object to inherit its") . "\n" .
"\t" . __("permissions settings from its parent.") . "\n" .
"\t" . __("For more detailed parameter usage info,") . "\n" .
"\t" . __("see help for the 'create' command."),
'inherit' => "inherit <aronode> <aconode> [<aco_action>]" . __("or", true) . " all\n" .
"\t" . __("Use this command to force a child ARO object to inherit its", true) . "\n" .
"\t" . __("permissions settings from its parent.", true) . "\n" .
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
"\t" . __("see help for the 'create' command.", true),
'view' => "view aro|aco [<node>]\n" .
"\t" . __("The view command will return the ARO or ACO tree.") . "\n" .

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc.
* Copyright 2005-2010, Cake Software Foundation, Inc.
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.tasks

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.console.libs.tasks

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.console.libs.template.objects

View file

@ -7,12 +7,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.

View file

@ -7,12 +7,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.

View file

@ -7,12 +7,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.console.libs.templates.objects

View file

@ -6,12 +6,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.console.libs.templates.objects

View file

@ -4,12 +4,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.templates.views

View file

@ -4,12 +4,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.templates.views

View file

@ -8,12 +8,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config

View file

@ -121,7 +121,8 @@
* - `Session.name` - The name of the cookie to use. Defaults to 'CAKEPHP'
* - `Session.timeout` - The number of minutes you want sessions to live for. This timeout is handled by CakePHP
* - `Session.cookieTimeout` - The number of minutes you want session cookies to live for.
* - `Session.checkAgent` - Do you want the user agent to be checked when starting sessions?
* - `Session.checkAgent` - Do you want the user agent to be checked when starting sessions? You might want to set the
* value to false, when dealing with older versions of IE, Chrome Frame or certain web-browsing devices and AJAX
* - `Session.defaults` - The default configuration set to use as a basis for your session.
* There are four builtins: php, cake, cache, database.
* - `Session.handler` - Can be used to enable a custom session handler. Expects an array of of callables,

View file

@ -3,12 +3,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app

View file

@ -4,12 +4,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.elements.email.html

View file

@ -4,12 +4,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.elements.email.text

View file

@ -4,12 +4,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.layouts

View file

@ -4,12 +4,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.templates.skel.views.layouts

View file

@ -4,12 +4,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.layouts.email.html

View file

@ -4,12 +4,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.layouts.email.text

View file

@ -750,9 +750,9 @@ class EmailComponent extends Component {
function _formatAddress($string, $smtp = false) {
$hasAlias = preg_match('/((.*)\s)?<(.+)>/', $string, $matches);
if ($smtp && $hasAlias) {
return $this->_strip(' <' . $matches[3] . '>');
return $this->_strip('<' . $matches[3] . '>');
} elseif ($smtp) {
return $this->_strip(' <' . $string . '>');
return $this->_strip('<' . $string . '>');
}
if ($hasAlias && !empty($matches[2])) {
return $this->_strip($matches[2] . ' <' . $matches[3] . '>');
@ -950,11 +950,6 @@ class EmailComponent extends Component {
} else {
$to = $this->to;
}
if ($this->delivery == 'smtp') {
$fm .= sprintf('%s %s%s', 'Host:', $this->smtpOptions['host'], $nl);
$fm .= sprintf('%s %s%s', 'Port:', $this->smtpOptions['port'], $nl);
$fm .= sprintf('%s %s%s', 'Timeout:', $this->smtpOptions['timeout'], $nl);
}
$fm .= sprintf('%s %s%s', 'To:', $to, $nl);
$fm .= sprintf('%s %s%s', 'From:', $this->from, $nl);
$fm .= sprintf('%s %s%s', 'Subject:', $this->_encode($this->subject), $nl);

View file

@ -116,7 +116,7 @@ class Debugger {
function __construct() {
$docRef = ini_get('docref_root');
if (empty($docRef)) {
if (empty($docRef) && function_exists('ini_set')) {
ini_set('docref_root', 'http://php.net/');
}
if (!defined('E_RECOVERABLE_ERROR')) {

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.log

View file

@ -247,13 +247,18 @@ class CakeSchema extends Object {
$Object = ClassRegistry::init(array('class' => $model, 'ds' => $connection));
if (is_object($Object) && $Object->useTable !== false) {
$table = $db->fullTableName($Object, false);
if (in_array($table, $currentTables)) {
$key = array_search($table, $currentTables);
$fulltable = $table = $db->fullTableName($Object, false);
if ($prefix && strpos($table, $prefix) !== 0) {
continue;
}
$table = str_replace($prefix, '', $table);
if (in_array($fulltable, $currentTables)) {
$key = array_search($fulltable, $currentTables);
if (empty($tables[$table])) {
$tables[$table] = $this->__columns($Object);
$tables[$table]['indexes'] = $db->index($Object);
$tables[$table]['tableParameters'] = $db->readTableParameters($table);
$tables[$table]['tableParameters'] = $db->readTableParameters($fulltable);
unset($currentTables[$key]);
}
if (!empty($Object->hasAndBelongsToMany)) {
@ -453,11 +458,11 @@ class CakeSchema extends Object {
if (!array_key_exists($table, $old)) {
$tables[$table]['add'] = $fields;
} else {
$diff = array_diff_assoc($fields, $old[$table]);
$diff = $this->_arrayDiffAssoc($fields, $old[$table]);
if (!empty($diff)) {
$tables[$table]['add'] = $diff;
}
$diff = array_diff_assoc($old[$table], $fields);
$diff = $this->_arrayDiffAssoc($old[$table], $fields);
if (!empty($diff)) {
$tables[$table]['drop'] = $diff;
}
@ -465,7 +470,7 @@ class CakeSchema extends Object {
foreach ($fields as $field => $value) {
if (isset($old[$table][$field])) {
$diff = array_diff_assoc($value, $old[$table][$field]);
$diff = $this->_arrayDiffAssoc($value, $old[$table][$field]);
if (!empty($diff) && $field !== 'indexes' && $field !== 'tableParameters') {
$tables[$table]['change'][$field] = array_merge($old[$table][$field], $diff);
}
@ -505,6 +510,46 @@ class CakeSchema extends Object {
return $tables;
}
/**
* Extended array_diff_assoc noticing change from/to NULL values
*
* It behaves almost the same way as array_diff_assoc except for NULL values: if
* one of the values is not NULL - change is detected. It is useful in situation
* where one value is strval('') ant other is strval(null) - in string comparing
* methods this results as EQUAL, while it is not.
*
* @param array $array1 Base array
* @param array $array2 Corresponding array checked for equality
* @return array Difference as array with array(keys => values) from input array
* where match was not found.
* @access protected
*/
function _arrayDiffAssoc($array1, $array2) {
$difference = array();
foreach ($array1 as $key => $value) {
if (!array_key_exists($key, $array2)) {
$difference[$key] = $value;
continue;
}
$correspondingValue = $array2[$key];
if (is_null($value) !== is_null($correspondingValue)) {
$difference[$key] = $value;
continue;
}
if (is_bool($value) !== is_bool($correspondingValue)) {
$difference[$key] = $value;
continue;
}
$value = strval($value);
$correspondingValue = strval($correspondingValue);
if ($value === $correspondingValue) {
continue;
}
$difference[$key] = $value;
}
return $difference;
}
/**
* Formats Schema columns from Model Object
*
@ -579,7 +624,7 @@ class CakeSchema extends Object {
if (!is_array($new) || !is_array($old)) {
return false;
}
$change = array_diff_assoc($new, $old);
$change = $this->_arrayDiffAssoc($new, $old);
return $change;
}
@ -597,12 +642,12 @@ class CakeSchema extends Object {
$add = $drop = array();
$diff = array_diff_assoc($new, $old);
$diff = $this->_arrayDiffAssoc($new, $old);
if (!empty($diff)) {
$add = $diff;
}
$diff = array_diff_assoc($old, $new);
$diff = $this->_arrayDiffAssoc($old, $new);
if (!empty($diff)) {
$drop = $diff;
}

View file

@ -1916,8 +1916,8 @@ class DboSource extends DataSource {
$quote
);
$cacheKey = crc32(serialize($cacheKey));
if (isset($this->methodCache[__FUNCTION__][$cacheKey])) {
return $this->methodCache[__FUNCTION__][$cacheKey];
if ($return = $this->cacheMethod(__FUNCTION__, $cacheKey)) {
return $return;
}
$allFields = empty($fields);
if ($allFields) {
@ -2007,7 +2007,7 @@ class DboSource extends DataSource {
if (!empty($virtual)) {
$fields = array_merge($fields, $this->_constructVirtualFields($model, $alias, $virtual));
}
return $this->methodCache[__FUNCTION__][$cacheKey] = array_unique($fields);
return $this->cacheMethod(__FUNCTION__, $cacheKey, array_unique($fields));
}
/**

View file

@ -239,7 +239,10 @@ class Router {
self::$_prefixes[] = $defaults['prefix'];
self::$_prefixes = array_keys(array_flip(self::$_prefixes));
}
$defaults += array('action' => 'index', 'plugin' => null);
$defaults += array('plugin' => null);
if (empty($options['action'])) {
$defaults += array('action' => 'index');
}
$routeClass = 'CakeRoute';
if (isset($options['routeClass'])) {
$routeClass = $options['routeClass'];

View file

@ -372,7 +372,7 @@ class Set {
$contexts = array($data);
}
}
$tokens = array_slice(preg_split('/(?<!=)\/(?![a-z-\s]*\])/', $path), 1);
$tokens = array_slice(preg_split('/(?<!=|\\\\)\/(?![a-z-\s]*\])/', $path), 1);
do {
$token = array_shift($tokens);

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.elements

View file

@ -4,12 +4,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.errors

View file

@ -40,6 +40,6 @@ class <?php echo $controller;?> extends AppController {
</pre>
<p class="notice">
<strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s.'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_action.ctp'); ?>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_action.ctp'); ?>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -4,12 +4,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.errors

View file

@ -4,12 +4,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.errors

View file

@ -1375,6 +1375,7 @@ class FormHelper extends AppHelper {
* that string is displayed as the empty element.
* - `escape` - If true contents of options will be HTML entity encoded. Defaults to true.
* - `value` The selected value of the input.
* - `class` - When using multiple = checkbox the classname to apply to the divs. Defaults to 'checkbox'.
*
* ### Using options
*
@ -1410,23 +1411,22 @@ class FormHelper extends AppHelper {
*/
public function select($fieldName, $options = array(), $attributes = array()) {
$select = array();
$showParents = false;
$escapeOptions = true;
$style = null;
$tag = null;
$showEmpty = '';
$attributes += array(
'class' => null,
'escape' => true,
'secure' => null,
'empty' => '',
'showParents' => false
);
$escapeOptions = $this->_extractOption('escape', $attributes);
$secure = $this->_extractOption('secure', $attributes);
$showEmpty = $this->_extractOption('empty', $attributes);
$showParents = $this->_extractOption('showParents', $attributes);
unset($attributes['escape'], $attributes['secure'], $attributes['empty'], $attributes['showParents']);
if (isset($attributes['escape'])) {
$escapeOptions = $attributes['escape'];
unset($attributes['escape']);
}
if (isset($attributes['secure'])) {
$secure = $attributes['secure'];
}
if (isset($attributes['empty'])) {
$showEmpty = $attributes['empty'];
unset($attributes['empty']);
}
$attributes = $this->_initInputField($fieldName, array_merge(
(array)$attributes, array('secure' => false)
));
@ -1439,10 +1439,6 @@ class FormHelper extends AppHelper {
if (isset($attributes['type'])) {
unset($attributes['type']);
}
if (in_array('showParents', $attributes)) {
$showParents = true;
unset($attributes['showParents']);
}
if (isset($attributes) && array_key_exists('multiple', $attributes)) {
$style = ($attributes['multiple'] === 'checkbox') ? 'checkbox' : null;
@ -1485,7 +1481,7 @@ class FormHelper extends AppHelper {
array_reverse($options, true),
array(),
$showParents,
array('escape' => $escapeOptions, 'style' => $style, 'name' => $attributes['name'], 'value' => $attributes['value'])
array('escape' => $escapeOptions, 'style' => $style, 'name' => $attributes['name'], 'value' => $attributes['value'], 'class' => $attributes['class'])
));
$template = ($style == 'checkbox') ? 'checkboxmultipleend' : 'selectend';
@ -1968,7 +1964,10 @@ class FormHelper extends AppHelper {
*/
function __selectOptions($elements = array(), $parents = array(), $showParents = null, $attributes = array()) {
$select = array();
$attributes = array_merge(array('escape' => true, 'style' => null, 'value' => null), $attributes);
$attributes = array_merge(
array('escape' => true, 'style' => null, 'value' => null, 'class' => null),
$attributes
);
$selectedIsEmpty = ($attributes['value'] === '' || $attributes['value'] === null);
$selectedIsArray = is_array($attributes['value']);

View file

@ -11,12 +11,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2006-2009, Cake Software Foundation, Inc.
* @copyright Copyright 2006-2010, Cake Software Foundation, Inc.
* @link http://cakephp.org CakePHP Project
* @package cake
* @subpackage cake.view.helpers

View file

@ -13,12 +13,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.libs.view.helpers

View file

@ -8,12 +8,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.libs.view.helpers

View file

@ -21,7 +21,7 @@ if (Configure::read() == 0):
endif;
?>
<h2><?php echo sprintf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2>
<a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-4"><?php __('Read the changelog'); ?> </a>
<a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-5"><?php __('Read the changelog'); ?> </a>
<?php
if (Configure::read() > 0):
Debugger::checkSecurityKeys();

View file

@ -6,12 +6,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.tests.cases.console.libs.tasks

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.tests.cases.console.libs.tasks

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.tests.cases.console.libs.tasks

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.tests.cases.console.libs.tasks

View file

@ -7,12 +7,12 @@
* PHP 5
*
* CakePHP : Rapid Development Framework (http://cakephp.org)
* Copyright 2006-2009, Cake Software Foundation, Inc.
* Copyright 2006-2010, Cake Software Foundation, Inc.
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2006-2009, Cake Software Foundation, Inc.
* @copyright Copyright 2006-2010, Cake Software Foundation, Inc.
* @link http://cakephp.org CakePHP Project
* @package cake
* @subpackage cake.tests.cases.console.libs.tasks

View file

@ -7,12 +7,12 @@
* PHP 5
*
* CakePHP : Rapid Development Framework (http://cakephp.org)
* Copyright 2006-2009, Cake Software Foundation, Inc.
* Copyright 2006-2010, Cake Software Foundation, Inc.
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2006-2009, Cake Software Foundation, Inc.
* @copyright Copyright 2006-2010, Cake Software Foundation, Inc.
* @link http://cakephp.org CakePHP Project
* @package cake
* @subpackage cake.tests.cases.console.libs.tasks

View file

@ -8,12 +8,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.tests.cases.console.libs.tasks

View file

@ -7,12 +7,12 @@
* PHP 5
*
* CakePHP : Rapid Development Framework (http://cakephp.org)
* Copyright 2006-2009, Cake Software Foundation, Inc.
* Copyright 2006-2010, Cake Software Foundation, Inc.
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2006-2009, Cake Software Foundation, Inc.
* @copyright Copyright 2006-2010, Cake Software Foundation, Inc.
* @link http://cakephp.org CakePHP Project
* @package cake
* @subpackage cake.tests.cases.console.libs.tasks

View file

@ -227,7 +227,7 @@ class MemcacheEngineTest extends CakeTestCase {
$result = Cache::read('other_test', 'memcache');
$this->assertFalse($result);
Cache::config('memcache', array('duration' => '+30 days'));
Cache::config('memcache', array('duration' => '+29 days'));
$data = 'this is a test of the emergency broadcasting system';
$result = Cache::write('long_expiry_test', $data, 'memcache');
$this->assertTrue($result);

View file

@ -1199,12 +1199,12 @@ HTMLBLOC;
$this->assertEqual($result, '<email@example.com>');
$result = $this->Controller->EmailTest->formatAddress('email@example.com', true);
$this->assertEqual($result, ' <email@example.com>');
$this->assertEqual($result, '<email@example.com>');
$result = $this->Controller->EmailTest->formatAddress('<email@example.com>', true);
$this->assertEqual($result, ' <email@example.com>');
$this->assertEqual($result, '<email@example.com>');
$result = $this->Controller->EmailTest->formatAddress('alias name <email@example.com>', true);
$this->assertEqual($result, ' <email@example.com>');
$this->assertEqual($result, '<email@example.com>');
}
}

View file

@ -750,6 +750,44 @@ class ControllerTest extends CakeTestCase {
$this->assertEqual($Controller->ControllerPaginateModel->extraCount, $expected);
}
/**
* testPaginateFieldsDouble method
*
* @return void
* @access public
*/
function testPaginateFieldsDouble(){
$Controller =& new Controller();
$Controller->uses = array('ControllerPost');
$Controller->params['url'] = array();
$Controller->constructClasses();
$Controller->paginate = array(
'fields' => array(
'ControllerPost.id',
'radians(180.0) as floatvalue'
),
'order' => array('ControllerPost.created'=>'DESC'),
'limit' => 1,
'page' => 1,
'recursive' => -1
);
$conditions = array();
$result = $Controller->paginate('ControllerPost',$conditions);
$expected = array(
array(
'ControllerPost' => array(
'id' => 3,
),
0 => array(
'floatvalue' => '3.14159265358979',
),
),
);
$this->assertEqual($result, $expected);
}
/**
* testPaginatePassedArgs method
*

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.cases.libs.log

View file

@ -7,7 +7,7 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.

View file

@ -3631,6 +3631,19 @@ class ContainableBehaviorTest extends CakeTestCase {
$this->assertNoErrors();
$this->assertEqual($result, 'First Article', 'Field is wrong');
}
/**
* test that find(all) doesn't return incorrect values when mixed with containable.
*
* @return void
*/
function testFindAllReturn() {
$result = $this->Article->find('all', array(
'conditions' => array('Article.id' => 999999999)
));
$this->assertEqual($result, array(), 'Should be empty.');
}
/**
* containments method
*

View file

@ -625,6 +625,20 @@ class CakeSchemaTest extends CakeTestCase {
}
/**
* test reading schema with config prefix.
*
* @return void
*/
function testSchemaReadWithConfigPrefix() {
$db =& ConnectionManager::getDataSource('test_suite');
$config = $db->config;
$config['prefix'] = 'schema_test_prefix_';
ConnectionManager::create('schema_prefix', $config);
$read = $this->Schema->read(array('connection' => 'schema_prefix', 'models' => false));
$this->assertTrue(empty($read['tables']));
}
/**
* test reading schema from plugins.
*
@ -812,6 +826,35 @@ class CakeSchemaTest extends CakeTestCase {
$this->assertEqual($expected, $compare);
}
/**
* test comparing '' and null and making sure they are different.
*
* @return void
*/
function testCompareEmptyStringAndNull() {
$One =& new CakeSchema(array(
'posts' => array(
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'name' => array('type' => 'string', 'null' => false, 'default' => '')
)
));
$Two =& new CakeSchema(array(
'posts' => array(
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'name' => array('type' => 'string', 'null' => false, 'default' => null)
)
));
$compare = $One->compare($Two);
$expected = array(
'posts' => array(
'change' => array(
'name' => array('type' => 'string', 'null' => false, 'default' => null)
)
)
);
$this->assertEqual($expected, $compare);
}
/**
* Test comparing tableParameters and indexes.
*

View file

@ -4568,4 +4568,18 @@ class DboSourceTest extends CakeTestCase {
$result = $Article->find('all');
$this->assertTrue(is_array($result));
}
/**
* test that fields() is using methodCache()
*
* @return void
*/
function testFieldsUsingMethodCache() {
$this->testDb->cacheMethods = false;
$this->assertTrue(empty($this->testDb->methodCache['fields']), 'Cache not empty');
$Article =& ClassRegistry::init('Article');
$this->testDb->fields($Article, null, array('title', 'body', 'published'));
$this->assertTrue(empty($this->testDb->methodCache['fields']), 'Cache not empty');
}
}

View file

@ -2166,6 +2166,27 @@ class ModelWriteTest extends BaseModelTest {
$this->assertFalse(empty($result));
}
/**
* test updating records and saving blank values.
*
* @return void
*/
function testUpdateSavingBlankValues() {
$this->loadFixtures('Article');
$Article =& new Article();
$Article->validate = array();
$Article->create();
$result = $Article->save(array(
'id' => 1,
'title' => '',
'body' => ''
));
$this->assertTrue($result);
$result = $Article->find('first', array('conditions' => array('Article.id' => 1)));
$this->assertEqual('', $result['Article']['title'], 'Title is not blank');
$this->assertEqual('', $result['Article']['body'], 'Body is not blank');
}
/**
* testUpdateMultiple method
*

View file

@ -392,4 +392,29 @@ class CakeRouteTestCase extends CakeTestCase {
$this->assertEqual($result['controller'], 'posts');
$this->assertEqual($result['action'], 'index');
}
/**
* test that patterns work for :action
*
* @return void
*/
function testPatternOnAction() {
$route =& new CakeRoute(
'/blog/:action/*',
array('controller' => 'blog_posts'),
array('action' => 'other|actions')
);
$result = $route->match(array('controller' => 'blog_posts', 'action' => 'foo'));
$this->assertFalse($result);
$result = $route->match(array('controller' => 'blog_posts', 'action' => 'actions'));
$this->assertNotEmpty($result);
$result = $route->parse('/blog/other');
$expected = array('controller' => 'blog_posts', 'action' => 'other', 'pass' => array(), 'named' => array());
$this->assertEqual($expected, $result);
$result = $route->parse('/blog/foobar');
$this->assertFalse($result);
}
}

View file

@ -1698,6 +1698,45 @@ class RouterTest extends CakeTestCase {
$this->assertEqual($result['pass'][0], 'something. . .', 'Period was chopped off %s');
}
/**
* test that patterns work for :action
*
* @return void
*/
function testParsingWithPatternOnAction() {
Router::reload();
Router::connect(
'/blog/:action/*',
array('controller' => 'blog_posts'),
array('action' => 'other|actions')
);
$result = Router::parse('/blog/other');
$expected = array(
'plugin' => null,
'controller' => 'blog_posts',
'action' => 'other',
'pass' => array(),
'named' => array()
);
$this->assertEqual($expected, $result);
$result = Router::parse('/blog/foobar');
$expected = array(
'plugin' => null,
'controller' => 'blog',
'action' => 'foobar',
'pass' => array(),
'named' => array()
);
$this->assertEqual($expected, $result);
$result = Router::url(array('controller' => 'blog_posts', 'action' => 'foo'));
$this->assertEqual('/blog_posts/foo', $result);
$result = Router::url(array('controller' => 'blog_posts', 'action' => 'actions'));
$this->assertEqual('/blog/actions', $result);
}
/**
* testParsingWithPrefixes method
*

View file

@ -888,6 +888,13 @@ class SetTest extends CakeTestCase {
$r = Set::extract('/file/.[type=application/x zip compressed]', $f);
$this->assertEqual($r, $expected);
$expected = array(
array('name' => 'zipfile.zip','type' => 'application/zip','tmp_name' => '/tmp/php178.tmp','error' => 0,'size' => '564647'),
array('name' => 'zipfile2.zip','type' => 'application/x zip compressed','tmp_name' => '/tmp/php179.tmp','error' => 0,'size' => '354784')
);
$r = Set::extract('/file/.[tmp_name=/tmp\/php17/]', $f);
$this->assertEqual($r, $expected);
$hasMany = array(
'Node' => array(
'id' => 1,

View file

@ -1229,7 +1229,7 @@ class FormHelperTest extends CakeTestCase {
$this->assertEqual($this->Form->fields, $expected);
$this->Form->fields = array();
$this->Form->select('Model.select', $options, null, array('multiple' => true));
$this->Form->select('Model.select', $options, array('multiple' => true));
$this->assertEqual($this->Form->fields, $expected);
}
@ -2503,7 +2503,7 @@ class FormHelperTest extends CakeTestCase {
);
$this->assertTags($result, $expected);
$result = $this->Form->select('Model.multi_field', array('1/2' => 'half'), null, array('multiple' => 'checkbox'));
$result = $this->Form->select('Model.multi_field', array('1/2' => 'half'), array('multiple' => 'checkbox'));
$expected = array(
'input' => array('type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '', 'id' => 'ModelMultiField'),
array('div' => array('class' => 'checkbox')),
@ -3127,7 +3127,7 @@ class FormHelperTest extends CakeTestCase {
2 => 'Two'
)
);
$result = $this->Form->select('Model.field', $options, null, array('empty' => false));
$result = $this->Form->select('Model.field', $options, array('empty' => false));
$expected = array(
'select' => array('name' => 'data[Model][field]', 'id' => 'ModelField'),
'optgroup' => array('label' => '&gt;&lt; Key'),
@ -3144,7 +3144,7 @@ class FormHelperTest extends CakeTestCase {
2 => 'Two'
)
);
$result = $this->Form->select('Model.field', $options, null, array('empty' => false, 'escape' => false));
$result = $this->Form->select('Model.field', $options, array('empty' => false, 'escape' => false));
$expected = array(
'select' => array('name' => 'data[Model][field]', 'id' => 'ModelField'),
'optgroup' => array('label' => '>< Key'),
@ -3507,6 +3507,49 @@ class FormHelperTest extends CakeTestCase {
$this->assertTags($result, $expected);
}
/**
* test multiple checkboxes with div styles.
*
* @return void
*/
function testSelectMultipleCheckboxDiv() {
$result = $this->Form->select(
'Model.tags',
array('first', 'second'),
array('multiple' => 'checkbox', 'class' => 'my-class')
);
$expected = array(
'input' => array(
'type' => 'hidden', 'name' => 'data[Model][tags]', 'value' => '', 'id' => 'ModelTags'
),
array('div' => array('class' => 'my-class')),
array('input' => array(
'type' => 'checkbox', 'name' => 'data[Model][tags][]',
'value' => '0', 'id' => 'ModelTags0'
)),
array('label' => array('for' => 'ModelTags0')), 'first', '/label',
'/div',
array('div' => array('class' => 'my-class')),
array('input' => array(
'type' => 'checkbox', 'name' => 'data[Model][tags][]',
'value' => '1', 'id' => 'ModelTags1'
)),
array('label' => array('for' => 'ModelTags1')), 'second', '/label',
'/div'
);
$this->assertTags($result, $expected);
$result = $this->Form->input('Model.tags', array(
'options' => array('first', 'second'),
'multiple' => 'checkbox',
'class' => 'my-class',
'div' => false,
'label' => false
));
$this->assertTags($result, $expected);
}
/**
* Checks the security hash array generated for multiple-input checkbox elements
*
@ -3519,7 +3562,7 @@ class FormHelperTest extends CakeTestCase {
$result = $this->Form->select(
'Model.multi_field', array('1' => 'first', '2' => 'second', '3' => 'third'),
null, array('multiple' => 'checkbox')
array('multiple' => 'checkbox')
);
$this->assertEqual($this->Form->fields, array('Model.multi_field'));
@ -4375,12 +4418,12 @@ class FormHelperTest extends CakeTestCase {
* @return void
*/
function testDatetimeWithDefault() {
$result = $this->Form->dateTime('Contact.updated', 'DMY', '12', null, array('value' => '2009-06-01 11:15:30'));
$result = $this->Form->dateTime('Contact.updated', 'DMY', '12', array('value' => '2009-06-01 11:15:30'));
$this->assertPattern('/<option[^<>]+value="2009"[^<>]+selected="selected"[^>]*>2009<\/option>/', $result);
$this->assertPattern('/<option[^<>]+value="01"[^<>]+selected="selected"[^>]*>1<\/option>/', $result);
$this->assertPattern('/<option[^<>]+value="06"[^<>]+selected="selected"[^>]*>June<\/option>/', $result);
$result = $this->Form->dateTime('Contact.updated', 'DMY', '12', null, array(
$result = $this->Form->dateTime('Contact.updated', 'DMY', '12', array(
'default' => '2009-06-01 11:15:30'
));
$this->assertPattern('/<option[^<>]+value="2009"[^<>]+selected="selected"[^>]*>2009<\/option>/', $result);

View file

@ -5,14 +5,14 @@
* PHP 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2006-2009, Cake Software Foundation, Inc.
* Copyright 2006-2010, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2006-2009, Cake Software Foundation, Inc.
* @copyright Copyright 2006-2010, Cake Software Foundation, Inc.
* @link http://cakephp.org CakePHP Project
* @package cake.tests
* @subpackage cake.tests.cases.views.helpers

View file

@ -7,14 +7,14 @@
* PHP 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2006-2009, Cake Software Foundation, Inc.
* Copyright 2006-2010, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2006-2009, Cake Software Foundation, Inc.
* @copyright Copyright 2006-2010, Cake Software Foundation, Inc.
* @link http://cakephp.org CakePHP Project
* @package cake.tests
* @subpackage cake.tests.cases.views.helpers

View file

@ -5,14 +5,14 @@
* PHP 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2006-2009, Cake Software Foundation, Inc.
* Copyright 2006-2010, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2006-2009, Cake Software Foundation, Inc.
* @copyright Copyright 2006-2010, Cake Software Foundation, Inc.
* @link http://cakephp.org CakePHP Project
* @package cake.tests
* @subpackage cake.tests.cases.views.helpers

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.fixtures

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.fixtures

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.tests.lib

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.tests.libs.reporter

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.tests.libs.reporter

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.tests.libs.reporter

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package cake
* @subpackage cake.cake.tests.libs

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.cases.libs

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.cases.libs

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.cases.libs

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.test_app

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.test_app

View file

@ -7,12 +7,12 @@
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config.sql

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.cases.libs

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.cases.libs

View file

@ -5,12 +5,12 @@
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package cake
* @subpackage cake.tests.cases.libs

View file

@ -7,12 +7,12 @@
* PHP 5
*
* CakePHP : Rapid Development Framework (http://cakephp.org)
* Copyright 2006-2009, Cake Software Foundation, Inc.
* Copyright 2006-2010, Cake Software Foundation, Inc.
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2006-2009, Cake Software Foundation, Inc.
* @copyright Copyright 2006-2010, Cake Software Foundation, Inc.
* @link http://cakephp.org CakePHP Project
* @package cake
* @subpackage cake.cake.tests.test_app.plugins.test_plugin