mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Merge branch '2.0' into 2.0-phpunit
Conflicts: cake/tests/cases/console/libs/tasks/controller.test.php cake/tests/cases/libs/code_coverage_manager.test.php cake/tests/cases/libs/view/helpers/js.test.php cake/tests/lib/code_coverage_manager.php
This commit is contained in:
commit
fc79dc6232
272 changed files with 919 additions and 667 deletions
|
@ -157,6 +157,11 @@
|
|||
|
||||
/**
|
||||
* The name of CakePHP's session cookie.
|
||||
*
|
||||
* Note the guidelines for Session names states: "The session name references
|
||||
* the session id in cookies and URLs. It should contain only alphanumeric
|
||||
* characters."
|
||||
* @link http://php.net/session_name
|
||||
*/
|
||||
Configure::write('Session.cookie', 'CAKEPHP');
|
||||
|
||||
|
@ -183,8 +188,8 @@
|
|||
* Valid values:
|
||||
*
|
||||
* 'high' Session timeout in 'Session.timeout' x 10
|
||||
* 'medium' Session timeout in 'Session.timeout' x 100
|
||||
* 'low' Session timeout in 'Session.timeout' x 300
|
||||
* 'medium' Session timeout in 'Session.timeout' x 5040
|
||||
* 'low' Session timeout in 'Session.timeout' x 2628000
|
||||
*
|
||||
* CakePHP session IDs are also regenerated between requests if
|
||||
* 'Security.level' is set to 'high'.
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing
|
||||
* @package cake
|
||||
* @subpackage cake.cake.tests.libs
|
||||
* @subpackage cake.app.webroot
|
||||
* @since CakePHP(tm) v 1.2.0.4433
|
||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||
*/
|
||||
|
|
|
@ -432,7 +432,7 @@ class ShellDispatcher {
|
|||
$printOptions = '(' . implode('/', $options) . ')';
|
||||
}
|
||||
|
||||
if ($default == null) {
|
||||
if ($default === null) {
|
||||
$this->stdout($prompt . " $printOptions \n" . '> ', false);
|
||||
} else {
|
||||
$this->stdout($prompt . " $printOptions \n" . "[$default] > ", false);
|
||||
|
|
|
@ -551,13 +551,13 @@ class Shell extends Object {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates the proper singular model key for associations
|
||||
* Creates the proper underscored model key for associations
|
||||
*
|
||||
* @param string $name Controller class name
|
||||
* @param string $name Model class name
|
||||
* @return string Singular model key
|
||||
*/
|
||||
protected function _modelKey($name) {
|
||||
return Inflector::underscore(Inflector::singularize($name)) . '_id';
|
||||
return Inflector::underscore($name) . '_id';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -284,7 +284,7 @@ class ControllerTask extends BakeTask {
|
|||
$controllerPath = $this->_controllerPath($controllerName);
|
||||
$pluralName = $this->_pluralName($currentModelName);
|
||||
$singularName = Inflector::variable($currentModelName);
|
||||
$singularHumanName = $this->_singularHumanName($currentModelName);
|
||||
$singularHumanName = $this->_singularHumanName($controllerName);
|
||||
$pluralHumanName = $this->_pluralName($controllerName);
|
||||
|
||||
$this->Template->set(compact('admin', 'controllerPath', 'pluralName', 'singularName', 'singularHumanName',
|
||||
|
|
|
@ -54,7 +54,7 @@ class TemplateTask extends Shell {
|
|||
protected function _findThemes() {
|
||||
$paths = App::path('shells');
|
||||
$core = array_pop($paths);
|
||||
$core = str_replace('libs' . DS, '', $core);
|
||||
$core = preg_replace('#libs' . DS . '$#', '', $core);
|
||||
$paths[] = $core;
|
||||
$Folder =& new Folder($core . 'templates' . DS . 'default');
|
||||
$contents = $Folder->read();
|
||||
|
|
|
@ -94,14 +94,12 @@ class TestTask extends BakeTask {
|
|||
$this->out(sprintf(__('Path: %s'), $this->path));
|
||||
$this->hr();
|
||||
|
||||
$selection = null;
|
||||
if ($type) {
|
||||
$type = Inflector::camelize($type);
|
||||
if (!in_array($type, $this->classTypes)) {
|
||||
unset($type);
|
||||
$this->error(sprintf('Incorrect type provided. Please choose one of %s', implode(', ', $this->classTypes)));
|
||||
}
|
||||
}
|
||||
if (!$type) {
|
||||
} else {
|
||||
$type = $this->getObjectType();
|
||||
}
|
||||
$className = $this->getClassName($type);
|
||||
|
|
|
@ -195,6 +195,7 @@ class ViewTask extends BakeTask {
|
|||
$actions = $this->_methodsToBake();
|
||||
}
|
||||
$this->bakeActions($actions, $vars);
|
||||
$actions = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -290,7 +291,7 @@ class ViewTask extends BakeTask {
|
|||
$primaryKey = $modelObj->primaryKey;
|
||||
$displayField = $modelObj->displayField;
|
||||
$singularVar = Inflector::variable($modelClass);
|
||||
$singularHumanName = $this->_singularHumanName($modelClass);
|
||||
$singularHumanName = $this->_singularHumanName($this->controllerName);
|
||||
$schema = $modelObj->schema(true);
|
||||
$fields = array_keys($schema);
|
||||
$associations = $this->__associations($modelObj);
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.cake.console.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4433
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.cake.tests.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4433
|
||||
|
|
|
@ -130,6 +130,14 @@ class CakeSession extends Object {
|
|||
*/
|
||||
public $host = null;
|
||||
|
||||
/**
|
||||
* Session timeout multiplier factor
|
||||
*
|
||||
* @var ineteger
|
||||
* @access public
|
||||
*/
|
||||
var $timeout = null;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -455,20 +463,20 @@ class CakeSession extends Object {
|
|||
|
||||
switch ($this->security) {
|
||||
case 'high':
|
||||
$this->cookieLifeTime = 0;
|
||||
$this->cookieLifeTime = Configure::read('Session.timeout') * Security::inactiveMins();
|
||||
if ($iniSet) {
|
||||
ini_set('session.referer_check', $this->host);
|
||||
}
|
||||
break;
|
||||
case 'medium':
|
||||
$this->cookieLifeTime = 7 * 86400;
|
||||
$this->cookieLifeTime = Configure::read('Session.timeout') * Security::inactiveMins();
|
||||
if ($iniSet) {
|
||||
ini_set('session.referer_check', $this->host);
|
||||
}
|
||||
break;
|
||||
case 'low':
|
||||
default:
|
||||
$this->cookieLifeTime = 788940000;
|
||||
$this->cookieLifeTime = Configure::read('Session.timeout') * Security::inactiveMins();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -591,15 +599,14 @@ class CakeSession extends Object {
|
|||
if ((Configure::read('Session.checkAgent') === false || $this->_userAgent == $this->read('Config.userAgent')) && $this->time <= $this->read('Config.time')) {
|
||||
$time = $this->read('Config.time');
|
||||
$this->write('Config.time', $this->sessionTime);
|
||||
|
||||
if (Configure::read('Security.level') === 'high') {
|
||||
$check = $this->read('Config.timeout');
|
||||
$check = $check - 1;
|
||||
$check -= 1;
|
||||
$this->write('Config.timeout', $check);
|
||||
|
||||
if (time() > ($time - (Security::inactiveMins() * Configure::read('Session.timeout')) + 2) || $check < 1) {
|
||||
$this->renew();
|
||||
$this->write('Config.timeout', 10);
|
||||
$this->write('Config.timeout', Security::inactiveMins());
|
||||
}
|
||||
}
|
||||
$this->valid = true;
|
||||
|
@ -611,7 +618,7 @@ class CakeSession extends Object {
|
|||
} else {
|
||||
$this->write('Config.userAgent', $this->_userAgent);
|
||||
$this->write('Config.time', $this->sessionTime);
|
||||
$this->write('Config.timeout', 10);
|
||||
$this->write('Config.timeout', Security::inactiveMins());
|
||||
$this->valid = true;
|
||||
$this->__setError(1, 'Session is valid');
|
||||
}
|
||||
|
@ -738,21 +745,7 @@ class CakeSession extends Object {
|
|||
* @access private
|
||||
*/
|
||||
function __write($id, $data) {
|
||||
switch (Configure::read('Security.level')) {
|
||||
case 'medium':
|
||||
$factor = 100;
|
||||
break;
|
||||
case 'low':
|
||||
$factor = 300;
|
||||
break;
|
||||
case 'high':
|
||||
default:
|
||||
$factor = 10;
|
||||
break;
|
||||
}
|
||||
|
||||
$expires = time() + Configure::read('Session.timeout') * $factor;
|
||||
|
||||
$expires = time() + Configure::read('Session.timeout') * Security::inactiveMins();
|
||||
$model =& ClassRegistry::getObject('Session');
|
||||
$return = $model->save(compact('id', 'data', 'expires'));
|
||||
return $return;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
*
|
||||
* @package cake
|
||||
* @subpackage cake.cake.libs.controller
|
||||
* @link http://book.cakephp.org/view/62/Components
|
||||
* @link http://book.cakephp.org/view/993/Components
|
||||
*/
|
||||
class Component extends Object {
|
||||
|
||||
|
|
|
@ -258,8 +258,9 @@ class RequestHandlerComponent extends Object {
|
|||
*
|
||||
* @param object $controller A reference to the controller
|
||||
* @param mixed $url A string or array containing the redirect location
|
||||
* @param mixed HTTP Status for redirect
|
||||
*/
|
||||
public function beforeRedirect(&$controller, $url) {
|
||||
public function beforeRedirect(&$controller, $url, $status = null) {
|
||||
if (!$this->isAjax()) {
|
||||
return;
|
||||
}
|
||||
|
@ -269,6 +270,12 @@ class RequestHandlerComponent extends Object {
|
|||
if (is_array($url)) {
|
||||
$url = Router::url($url + array('base' => false));
|
||||
}
|
||||
if (!empty($status)) {
|
||||
$statusCode = $controller->httpCodes($status);
|
||||
$code = key($statusCode);
|
||||
$msg = $statusCode[$code];
|
||||
$controller->header("HTTP/1.1 {$code} {$msg}");
|
||||
}
|
||||
echo $this->requestAction($url, array('return'));
|
||||
$this->_stop();
|
||||
}
|
||||
|
|
|
@ -109,7 +109,6 @@ class SecurityComponent extends Object {
|
|||
|
||||
/**
|
||||
* An associative array of usernames/passwords used for HTTP-authenticated logins.
|
||||
* If using digest authentication, passwords should be MD5-hashed.
|
||||
*
|
||||
* @var array
|
||||
* @access public
|
||||
|
|
|
@ -172,6 +172,7 @@ class L10n {
|
|||
/* Urdu */ 'urd' => 'ur',
|
||||
/* Venda */ 'ven' => 've',
|
||||
/* Vietnamese */ 'vie' => 'vi',
|
||||
/* Welsh */ 'cym' => 'cy',
|
||||
/* Xhosa */ 'xho' => 'xh',
|
||||
/* Yiddish */ 'yid' => 'yi',
|
||||
/* Zulu */ 'zul' => 'zu');
|
||||
|
@ -315,6 +316,7 @@ class L10n {
|
|||
'ur' => array('language' => 'Urdu', 'locale' => 'urd', 'localeFallback' => 'urd', 'charset' => 'utf-8', 'direction' => 'rtl'),
|
||||
've' => array('language' => 'Venda', 'locale' => 'ven', 'localeFallback' => 'ven', 'charset' => 'utf-8', 'direction' => 'ltr'),
|
||||
'vi' => array('language' => 'Vietnamese', 'locale' => 'vie', 'localeFallback' => 'vie', 'charset' => 'utf-8', 'direction' => 'ltr'),
|
||||
'cy' => array('language' => 'Welsh', 'locale' => 'cym', 'localeFallback' => 'cym', 'charset' => 'utf-8', 'direction' => 'ltr'),
|
||||
'xh' => array('language' => 'Xhosa', 'locale' => 'xho', 'localeFallback' => 'xho', 'charset' => 'utf-8', 'direction' => 'ltr'),
|
||||
'yi' => array('language' => 'Yiddish', 'locale' => 'yid', 'localeFallback' => 'yid', 'charset' => 'utf-8', 'direction' => 'ltr'),
|
||||
'zh' => array('language' => 'Chinese', 'locale' => 'chi', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr'),
|
||||
|
|
|
@ -726,8 +726,8 @@ class DboMysql extends DboMysqlBase {
|
|||
$j = 0;
|
||||
|
||||
while ($j < $numFields) {
|
||||
$column = mysql_fetch_field($results,$j);
|
||||
if (!empty($column->table)) {
|
||||
$column = mysql_fetch_field($results, $j);
|
||||
if (!empty($column->table) && strpos($column->name, '__') === false) {
|
||||
$this->map[$index++] = array($column->table, $column->name);
|
||||
} else {
|
||||
$this->map[$index++] = array(0, $column->name);
|
||||
|
|
|
@ -1263,7 +1263,7 @@ class Model extends Object {
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($this->data[$this->alias][$this->primaryKey]) && empty($this->data[$this->alias][$this->primaryKey])) {
|
||||
if (empty($this->data[$this->alias][$this->primaryKey])) {
|
||||
unset($this->data[$this->alias][$this->primaryKey]);
|
||||
}
|
||||
$fields = $values = array();
|
||||
|
|
|
@ -361,6 +361,7 @@ class BehaviorCollection extends Object {
|
|||
* @return void
|
||||
*/
|
||||
public function detach($name) {
|
||||
list($plugin, $name) = pluginSplit($name);
|
||||
if (isset($this->{$name})) {
|
||||
$this->{$name}->cleanup(ClassRegistry::getObject($this->modelName));
|
||||
unset($this->{$name});
|
||||
|
|
|
@ -156,7 +156,7 @@ class Sanitize {
|
|||
* @static
|
||||
*/
|
||||
public static function stripScripts($str) {
|
||||
return preg_replace('/(<link[^>]+rel="[^"]*stylesheet"[^>]*>|<img[^>]*>|style="[^"]*")|<script[^>]*>.*?<\/script>|<style[^>]*>.*?<\/style>|<!--.*?-->/i', '', $str);
|
||||
return preg_replace('/(<link[^>]+rel="[^"]*stylesheet"[^>]*>|<img[^>]*>|style="[^"]*")|<script[^>]*>.*?<\/script>|<style[^>]*>.*?<\/style>|<!--.*?-->/is', '', $str);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -382,13 +382,13 @@ class Validation {
|
|||
}
|
||||
|
||||
if ($return === true && preg_match('/@(' . self::$__pattern['hostname'] . ')$/i', $check, $regs)) {
|
||||
$host = gethostbynamel($regs[1]);
|
||||
$return = is_array($host);
|
||||
$isWindows = (DIRECTORY_SEPARATOR === '\\');
|
||||
if (!$isWindows || (version_compare(PHP_VERSION, '5.3.0', '>=') && $isWindows)) {
|
||||
$return = $return && getmxrr($regs[1], $mxhosts);
|
||||
if (function_exists('getmxrr') && getmxrr($regs[1], $mxhosts)) {
|
||||
return true;
|
||||
}
|
||||
return $return;
|
||||
if (function_exists('checkdnsrr') && checkdnsrr($regs[1], 'MX')) {
|
||||
return true;
|
||||
}
|
||||
return is_array(gethostbynamel($regs[1]));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -211,7 +211,7 @@ class FormHelper extends AppHelper {
|
|||
}
|
||||
}
|
||||
|
||||
$object =& $this->_introspectModel($model);
|
||||
$object = $this->_introspectModel($model);
|
||||
$this->setEntity($model . '.', true);
|
||||
|
||||
$modelEntity = $this->model();
|
||||
|
|
|
@ -252,9 +252,13 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
if (isset($options['update'])) {
|
||||
$wrapCallbacks = isset($options['wrapCallbacks']) ? $options['wrapCallbacks'] : true;
|
||||
if ($wrapCallbacks) {
|
||||
$success = '$("' . $options['update'] . '").html(data);';
|
||||
$success = $this->jQueryObject . '("' . $options['update'] . '").html(data);';
|
||||
} else {
|
||||
$success = 'function (data, textStatus) {$("' . $options['update'] . '").html(data);}';
|
||||
$success = sprintf(
|
||||
'function (data, textStatus) {%s("%s").html(data);}',
|
||||
$this->jQueryObject,
|
||||
$options['update']
|
||||
);
|
||||
}
|
||||
$options['dataType'] = 'html';
|
||||
$options['success'] = $success;
|
||||
|
@ -267,7 +271,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
}
|
||||
$options = $this->_prepareCallbacks('request', $options);
|
||||
$options = $this->_parseOptions($options, $callbacks);
|
||||
return '$.ajax({' . $options .'});';
|
||||
return $this->jQueryObject . '.ajax({' . $options .'});';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -301,17 +301,22 @@ class JsHelper extends AppHelper {
|
|||
list($options, $htmlOptions) = $this->_getHtmlOptions($options);
|
||||
$out = $this->Html->link($title, $url, $htmlOptions);
|
||||
$this->get('#' . $htmlOptions['id']);
|
||||
$requestString = '';
|
||||
$requestString = $event = '';
|
||||
if (isset($options['confirm'])) {
|
||||
$requestString = $this->confirmReturn($options['confirm']);
|
||||
unset($options['confirm']);
|
||||
}
|
||||
$buffer = isset($options['buffer']) ? $options['buffer'] : null;
|
||||
$safe = isset($options['safe']) ? $options['safe'] : true;
|
||||
unset($options['buffer'], $options['safe']);
|
||||
|
||||
$requestString .= $this->request($url, $options);
|
||||
|
||||
if (!empty($requestString)) {
|
||||
$event = $this->event('click', $requestString, $options);
|
||||
$event = $this->event('click', $requestString, $options + array('buffer' => $buffer));
|
||||
}
|
||||
if (isset($options['buffer']) && $options['buffer'] == false) {
|
||||
$opts = array_intersect_key(array('safe' => null), $options);
|
||||
if (isset($buffer) && !$buffer) {
|
||||
$opts = array('safe' => $safe);
|
||||
$out .= $this->Html->scriptBlock($event, $opts);
|
||||
}
|
||||
return $out;
|
||||
|
@ -351,8 +356,16 @@ class JsHelper extends AppHelper {
|
|||
* Forms submitting with this method, cannot send files. Files do not transfer over XmlHttpRequest
|
||||
* and require an iframe or flash.
|
||||
*
|
||||
* ### Options
|
||||
*
|
||||
* - `url` The url you wish the XHR request to submit to.
|
||||
* - `confirm` A string to use for a confirm() message prior to submitting the request.
|
||||
* - `method` The method you wish the form to send by, defaults to POST
|
||||
* - `buffer` Whether or not you wish the script code to be buffered, defaults to true.
|
||||
* - Also see options for JsHelper::request() and JsHelper::event()
|
||||
*
|
||||
* @param string $title The display text of the submit button.
|
||||
* @param array $options Array of options to use.
|
||||
* @param array $options Array of options to use. See the options for the above mentioned methods.
|
||||
* @return string Completed submit button.
|
||||
*/
|
||||
public function submit($caption = null, $options = array()) {
|
||||
|
@ -379,12 +392,17 @@ class JsHelper extends AppHelper {
|
|||
$options['method'] = 'post';
|
||||
}
|
||||
$options['dataExpression'] = true;
|
||||
|
||||
$buffer = isset($options['buffer']) ? $options['buffer'] : null;
|
||||
$safe = isset($options['safe']) ? $options['safe'] : true;
|
||||
unset($options['buffer'], $options['safe']);
|
||||
|
||||
$requestString .= $this->request($url, $options);
|
||||
if (!empty($requestString)) {
|
||||
$event = $this->event('click', $requestString, $options);
|
||||
$event = $this->event('click', $requestString, $options + array('buffer' => $buffer));
|
||||
}
|
||||
if (isset($options['buffer']) && $options['buffer'] == false) {
|
||||
$opts = array_intersect_key(array('safe' => null), $options);
|
||||
if (isset($buffer) && !$buffer) {
|
||||
$opts = array('safe' => $safe);
|
||||
$out .= $this->Html->scriptBlock($event, $opts);
|
||||
}
|
||||
return $out;
|
||||
|
|
|
@ -192,18 +192,10 @@ class PaginatorHelper extends AppHelper {
|
|||
}
|
||||
|
||||
if (isset($options['sort']) && !empty($options['sort'])) {
|
||||
if (preg_match('/(?:\w+\.)?(\w+)/', $options['sort'], $result) && isset($result[1])) {
|
||||
if ($result[0] == $this->defaultModel()) {
|
||||
return $result[1];
|
||||
}
|
||||
}
|
||||
return $options['sort'];
|
||||
} elseif (isset($options['order']) && is_array($options['order'])) {
|
||||
return key($options['order']);
|
||||
} elseif (isset($options['order']) && is_string($options['order'])) {
|
||||
if (preg_match('/(?:\w+\.)?(\w+)/', $options['order'], $result) && isset($result[1])) {
|
||||
return $result[1];
|
||||
}
|
||||
return $options['order'];
|
||||
}
|
||||
return null;
|
||||
|
@ -304,13 +296,18 @@ class PaginatorHelper extends AppHelper {
|
|||
unset($options['direction']);
|
||||
|
||||
$sortKey = $this->sortKey($options['model']);
|
||||
$isSorted = ($sortKey === $key || $sortKey === $this->defaultModel() . '.' . $key);
|
||||
$defaultModel = $this->defaultModel();
|
||||
$isSorted = (
|
||||
$sortKey === $key ||
|
||||
$sortKey === $defaultModel . '.' . $key ||
|
||||
$key === $defaultModel . '.' . $sortKey
|
||||
);
|
||||
|
||||
if ($isSorted) {
|
||||
$dir = $this->sortDir($options['model']) === 'asc' ? 'desc' : 'asc';
|
||||
$class = $dir === 'asc' ? 'desc' : 'asc';
|
||||
if (!empty($options['class'])) {
|
||||
$options['class'] .= $class;
|
||||
$options['class'] .= ' ' . $class;
|
||||
} else {
|
||||
$options['class'] = $class;
|
||||
}
|
||||
|
|
|
@ -106,8 +106,8 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
|
|||
<p>
|
||||
<?php
|
||||
echo $this->Html->link(
|
||||
sprintf('<strong>%s</strong>%s', __('new'), __('CakePHP 1.2 Docs')),
|
||||
'http://book.cakephp.org',
|
||||
sprintf('<strong>%s</strong>%s', __('new'), __('CakePHP 1.3 Docs')),
|
||||
'http://book.cakephp.org/view/875/x1-3-Collection',
|
||||
array('target' => '_blank', 'escape' => false)
|
||||
);
|
||||
?>
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc.
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc.
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.console
|
||||
* @since CakePHP(tm) v 1.2.0.5432
|
||||
|
|
|
@ -286,10 +286,10 @@ class ViewTaskTest extends CakeTestCase {
|
|||
);
|
||||
$result = $this->Task->getContent('view', $vars);
|
||||
|
||||
$this->assertPattern('/Delete .+Test View Model/', $result);
|
||||
$this->assertPattern('/Edit .+Test View Model/', $result);
|
||||
$this->assertPattern('/List .+Test View Models/', $result);
|
||||
$this->assertPattern('/New .+Test View Model/', $result);
|
||||
$this->assertPattern('/Delete Test View Model/', $result);
|
||||
$this->assertPattern('/Edit Test View Model/', $result);
|
||||
$this->assertPattern('/List Test View Models/', $result);
|
||||
$this->assertPattern('/New Test View Model/', $result);
|
||||
|
||||
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'id\'\]/', $result);
|
||||
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result);
|
||||
|
@ -318,10 +318,10 @@ class ViewTaskTest extends CakeTestCase {
|
|||
);
|
||||
$result = $this->Task->getContent('admin_view', $vars);
|
||||
|
||||
$this->assertPattern('/Delete .+Test View Model/', $result);
|
||||
$this->assertPattern('/Edit .+Test View Model/', $result);
|
||||
$this->assertPattern('/List .+Test View Models/', $result);
|
||||
$this->assertPattern('/New .+Test View Model/', $result);
|
||||
$this->assertPattern('/Delete Test View Model/', $result);
|
||||
$this->assertPattern('/Edit Test View Model/', $result);
|
||||
$this->assertPattern('/List Test View Models/', $result);
|
||||
$this->assertPattern('/New Test View Model/', $result);
|
||||
|
||||
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'id\'\]/', $result);
|
||||
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result);
|
||||
|
@ -330,7 +330,7 @@ class ViewTaskTest extends CakeTestCase {
|
|||
$result = $this->Task->getContent('admin_add', $vars);
|
||||
$this->assertPattern("/input\('name'\)/", $result);
|
||||
$this->assertPattern("/input\('body'\)/", $result);
|
||||
$this->assertPattern('/List .+Test View Models/', $result);
|
||||
$this->assertPattern('/List Test View Models/', $result);
|
||||
|
||||
Configure::write('Routing', $_back);
|
||||
}
|
||||
|
@ -390,7 +390,7 @@ class ViewTaskTest extends CakeTestCase {
|
|||
));
|
||||
$this->Task->expectAt(1, 'createFile', array(
|
||||
TMP . 'view_task_comments' . DS . 'edit.ctp',
|
||||
new PatternExpectation('/Edit .+View Task Comment/')
|
||||
new PatternExpectation('/Edit View Task Comment/')
|
||||
));
|
||||
$this->Task->expectAt(2, 'createFile', array(
|
||||
TMP . 'view_task_comments' . DS . 'index.ctp',
|
||||
|
@ -552,11 +552,11 @@ class ViewTaskTest extends CakeTestCase {
|
|||
));
|
||||
$this->Task->expectAt(2, 'createFile', array(
|
||||
TMP . 'view_task_comments' . DS . 'add.ctp',
|
||||
new PatternExpectation('/Add .+View Task Comment/')
|
||||
new PatternExpectation('/Add View Task Comment/')
|
||||
));
|
||||
$this->Task->expectAt(3, 'createFile', array(
|
||||
TMP . 'view_task_comments' . DS . 'edit.ctp',
|
||||
new PatternExpectation('/Edit .+View Task Comment/')
|
||||
new PatternExpectation('/Edit View Task Comment/')
|
||||
));
|
||||
|
||||
$this->Task->execute();
|
||||
|
@ -607,11 +607,11 @@ class ViewTaskTest extends CakeTestCase {
|
|||
));
|
||||
$this->Task->expectAt(2, 'createFile', array(
|
||||
TMP . 'view_task_comments' . DS . 'admin_add.ctp',
|
||||
new PatternExpectation('/Add .+View Task Comment/')
|
||||
new PatternExpectation('/Add View Task Comment/')
|
||||
));
|
||||
$this->Task->expectAt(3, 'createFile', array(
|
||||
TMP . 'view_task_comments' . DS . 'admin_edit.ctp',
|
||||
new PatternExpectation('/Edit .+View Task Comment/')
|
||||
new PatternExpectation('/Edit View Task Comment/')
|
||||
));
|
||||
|
||||
$this->Task->execute();
|
||||
|
@ -634,4 +634,5 @@ class ViewTaskTest extends CakeTestCase {
|
|||
$result = $this->Task->getTemplate('admin_add');
|
||||
$this->assertEqual($result, 'form');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.5432
|
||||
|
|
4
cake/tests/cases/libs/cache/apc.test.php
vendored
4
cake/tests/cases/libs/cache/apc.test.php
vendored
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.cache
|
||||
* @since CakePHP(tm) v 1.2.0.5434
|
||||
|
|
4
cake/tests/cases/libs/cache/file.test.php
vendored
4
cake/tests/cases/libs/cache/file.test.php
vendored
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.cache
|
||||
* @since CakePHP(tm) v 1.2.0.5434
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.cache
|
||||
* @since CakePHP(tm) v 1.2.0.5434
|
||||
|
|
4
cake/tests/cases/libs/cache/xcache.test.php
vendored
4
cake/tests/cases/libs/cache/xcache.test.php
vendored
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.cache
|
||||
* @since CakePHP(tm) v 1.2.0.5434
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.5432
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.cake.tests.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4667
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.5432
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.5432
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.controller
|
||||
* @since CakePHP(tm) v 1.2.0.5436
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
* @since CakePHP(tm) v 1.2.0.5435
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.cake.tests.cases.libs.controller.components
|
||||
* @since CakePHP(tm) v 1.2.0.5347
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
* @since CakePHP(tm) v 1.2.0.5435
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.cake.tests.cases.libs.controller.components
|
||||
* @since CakePHP(tm) v 1.2.0.5347
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
* @since CakePHP(tm) v 1.2.0.5435
|
||||
|
@ -21,6 +21,7 @@ App::import('Controller', 'Controller', false);
|
|||
App::import('Component', array('RequestHandler'));
|
||||
|
||||
Mock::generatePartial('RequestHandlerComponent', 'NoStopRequestHandler', array('_stop'));
|
||||
Mock::generatePartial('Controller', 'RequestHandlerMockController', array('header'));
|
||||
|
||||
/**
|
||||
* RequestHandlerTestController class
|
||||
|
@ -601,9 +602,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*/
|
||||
function testBeforeRedirectCallbackWithArrayUrl() {
|
||||
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
|
||||
App::build(array(
|
||||
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
|
||||
), true);
|
||||
|
||||
Router::setRequestInfo(array(
|
||||
array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'named' => array(), 'form' => array(), 'url' => array('url' => 'accounts/'), 'bare' => 0),
|
||||
array('base' => '/officespace', 'here' => '/officespace/accounts/', 'webroot' => '/officespace/')
|
||||
|
@ -618,7 +617,22 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
);
|
||||
$result = ob_get_clean();
|
||||
$this->assertEqual($result, 'one: first two: second');
|
||||
App::build();
|
||||
}
|
||||
|
||||
/**
|
||||
* assure that beforeRedirect with a status code will correctly set the status header
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testBeforeRedirectCallingHeader() {
|
||||
$controller =& new RequestHandlerMockController();
|
||||
$RequestHandler =& new NoStopRequestHandler();
|
||||
|
||||
$controller->expectOnce('header', array('HTTP/1.1 403 Forbidden'));
|
||||
|
||||
ob_start();
|
||||
$RequestHandler->beforeRedirect($controller, 'request_handler_test/param_method/first/second', 403);
|
||||
$result = ob_get_clean();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
* @since CakePHP(tm) v 1.2.0.5435
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.controller.components
|
||||
* @since CakePHP(tm) v 1.2.0.5436
|
||||
|
@ -339,4 +339,41 @@ class SessionComponentTest extends CakeTestCase {
|
|||
$Session->destroy('Test');
|
||||
$this->assertNull($Session->read('Test'));
|
||||
}
|
||||
|
||||
/**
|
||||
* testSessionTimeout method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testSessionTimeout() {
|
||||
|
||||
session_destroy();
|
||||
Configure::write('Security.level', 'low');
|
||||
$Session =& new SessionComponent();
|
||||
$Session->write('Test', 'some value');
|
||||
$this->assertEqual($_SESSION['Config']['timeout'], Security::inactiveMins());
|
||||
$this->assertEqual($_SESSION['Config']['time'], $Session->sessionTime);
|
||||
$this->assertEqual($Session->time, mktime());
|
||||
$this->assertEqual($_SESSION['Config']['time'], $Session->time + (Security::inactiveMins() * Configure::read('Session.timeout')));
|
||||
|
||||
session_destroy();
|
||||
Configure::write('Security.level', 'medium');
|
||||
$Session =& new SessionComponent();
|
||||
$Session->write('Test', 'some value');
|
||||
$this->assertEqual($_SESSION['Config']['timeout'], Security::inactiveMins());
|
||||
$this->assertEqual($_SESSION['Config']['time'], $Session->sessionTime);
|
||||
$this->assertEqual($Session->time, mktime());
|
||||
$this->assertEqual($_SESSION['Config']['time'], $Session->time + (Security::inactiveMins() * Configure::read('Session.timeout')));
|
||||
|
||||
session_destroy();
|
||||
Configure::write('Security.level', 'high');
|
||||
$Session =& new SessionComponent();
|
||||
$Session->write('Test', 'some value');
|
||||
$this->assertEqual($_SESSION['Config']['timeout'], Security::inactiveMins());
|
||||
$this->assertEqual($_SESSION['Config']['time'], $Session->sessionTime);
|
||||
$this->assertEqual($Session->time, mktime());
|
||||
$this->assertEqual($_SESSION['Config']['time'], $Session->time + (Security::inactiveMins() * Configure::read('Session.timeout')));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.controller
|
||||
* @since CakePHP(tm) v 1.2.3
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.controller
|
||||
* @since CakePHP(tm) v 1.2.0.5436
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.controller
|
||||
* @since CakePHP(tm) v 1.2.0.5436
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.5432
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.5432
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://book.cakephp.org/view/160/Testing
|
||||
* @link http://book.cakephp.org/view/1196/Testing
|
||||
* @package cake.tests
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.5432
|
||||
|
@ -427,6 +427,10 @@ class L10nTest extends CakeTestCase {
|
|||
$expected = array('xho' => 'xh', 'xh' => 'xho');
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $l10n->map(array('cy', 'cym'));
|
||||
$expected = array('cym' => 'cy', 'cy' => 'cym');
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $l10n->map(array('yid', 'yi'));
|
||||
$expected = array('yid' => 'yi', 'yi' => 'yid');
|
||||
$this->assertEqual($result, $expected);
|
||||
|
@ -878,6 +882,13 @@ class L10nTest extends CakeTestCase {
|
|||
);
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $l10n->catalog(array('cy'));
|
||||
$expected = array(
|
||||
'cy' => array('language' => 'Welsh', 'locale' => 'cym', 'localeFallback' => 'cym', 'charset' => 'utf-8',
|
||||
'direction' => 'ltr')
|
||||
);
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $l10n->catalog(array('xh'));
|
||||
$expected = array(
|
||||
'xh' => array('language' => 'Xhosa', 'locale' => 'xho', 'localeFallback' => 'xho', 'charset' => 'utf-8', 'direction' => 'ltr')
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.log
|
||||
* @since CakePHP(tm) v 1.3
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.model.behaviors
|
||||
* @since CakePHP(tm) v 1.2.0.5669
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.model.behaviors
|
||||
* @since CakePHP(tm) v 1.2.0.5669
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.model.behaviors
|
||||
* @since CakePHP(tm) v 1.2.0.5330
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.5550
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.5550
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.model.datasources
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.controller.components.dbacl.models
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.model
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -504,6 +504,28 @@ class BehaviorTest extends CakeTestCase {
|
|||
$this->assertEqual($Apple->Behaviors->Test->settings['Apple'], $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* test that attach()/detach() works with plugin.banana
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testDetachWithPluginNames() {
|
||||
$Apple = new Apple();
|
||||
$Apple->Behaviors->attach('Plugin.Test');
|
||||
$this->assertTrue(isset($Apple->Behaviors->Test), 'Missing behavior');
|
||||
$this->assertEqual($Apple->Behaviors->attached(), array('Test'));
|
||||
|
||||
$Apple->Behaviors->detach('Plugin.Test');
|
||||
$this->assertEqual($Apple->Behaviors->attached(), array());
|
||||
|
||||
$Apple->Behaviors->attach('Plugin.Test');
|
||||
$this->assertTrue(isset($Apple->Behaviors->Test), 'Missing behavior');
|
||||
$this->assertEqual($Apple->Behaviors->attached(), array('Test'));
|
||||
|
||||
$Apple->Behaviors->detach('Test');
|
||||
$this->assertEqual($Apple->Behaviors->attached(), array());
|
||||
}
|
||||
|
||||
/**
|
||||
* test that attaching a non existant Behavior triggers a cake error.
|
||||
*
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.model
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.model
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.model
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
@ -7291,6 +7291,21 @@ class ModelReadTest extends BaseModelTest {
|
|||
$this->assertTrue(isset($result['Author']['full_name']));
|
||||
}
|
||||
|
||||
/**
|
||||
* test that virtual fields work when they don't contain functions.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testVirtualFieldAsAString() {
|
||||
$this->loadFixtures('Post', 'Author');
|
||||
$Post =& new Post();
|
||||
$Post->virtualFields = array(
|
||||
'writer' => 'Author.user'
|
||||
);
|
||||
$result = $Post->find('first');
|
||||
$this->assertTrue(isset($result['Post']['writer']), 'virtual field not fetched %s');
|
||||
}
|
||||
|
||||
/**
|
||||
* test that isVirtualField will accept both aliased and non aliased fieldnames
|
||||
*
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.model
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.model
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
@ -897,6 +897,30 @@ class ModelWriteTest extends BaseModelTest {
|
|||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* test that a null Id doesn't cause errors
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSaveWithNullId() {
|
||||
$this->loadFixtures('User');
|
||||
$User =& new User();
|
||||
$User->read(null, 1);
|
||||
$User->data['User']['id'] = null;
|
||||
$this->assertTrue($User->save(array('password' => 'test')));
|
||||
$this->assertTrue($User->id > 0);
|
||||
|
||||
$result = $User->read(null, 2);
|
||||
$User->data['User']['id'] = null;
|
||||
$this->assertTrue($User->save(array('password' => 'test')));
|
||||
$this->assertTrue($User->id > 0);
|
||||
|
||||
$User->data['User'] = array('password' => 'something');
|
||||
$this->assertTrue($User->save());
|
||||
$result = $User->read();
|
||||
$this->assertEqual($User->data['User']['password'], 'something');
|
||||
}
|
||||
|
||||
/**
|
||||
* testSaveWithSet method
|
||||
*
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.model
|
||||
* @since CakePHP(tm) v 1.2.0.6464
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.6833
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.5432
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.5428
|
||||
|
@ -334,6 +334,32 @@ class SanitizeTest extends CakeTestCase {
|
|||
$expected = '';
|
||||
$result = Sanitize::stripScripts($string);
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$string = <<<HTML
|
||||
text
|
||||
<style type="text/css">
|
||||
<!--
|
||||
#content { display:none; }
|
||||
-->
|
||||
</style>
|
||||
text
|
||||
HTML;
|
||||
$expected = "text\n\ntext";
|
||||
$result = Sanitize::stripScripts($string);
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$string = <<<HTML
|
||||
text
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
alert('wooo');
|
||||
-->
|
||||
</script>
|
||||
text
|
||||
HTML;
|
||||
$expected = "text\n\ntext";
|
||||
$result = Sanitize::stripScripts($string);
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.5432
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.5432
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
|
@ -13,7 +13,7 @@
|
|||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP Version 5.x
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @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
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2006-2010, Cake Software Foundation, Inc.
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2006-2010, Cake Software Foundation, Inc.
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2006-2010, Cake Software Foundation, Inc.
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2006-2010, Cake Software Foundation, Inc.
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -209,6 +209,26 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
|
|||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* test that alternate jQuery object values work for request()
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testRequestWithAlternateJqueryObject() {
|
||||
$this->Jquery->jQueryObject = '$j';
|
||||
|
||||
$result = $this->Jquery->request('/people/edit/1', array(
|
||||
'update' => '#updated',
|
||||
'success' => 'doFoo',
|
||||
'method' => 'post',
|
||||
'dataExpression' => true,
|
||||
'data' => '$j("#someId").serialize()',
|
||||
'wrapCallbacks' => false
|
||||
));
|
||||
$expected = '$j.ajax({data:$j("#someId").serialize(), dataType:"html", success:function (data, textStatus) {$j("#updated").html(data);}, type:"post", url:"\\/people\\/edit\\/1"});';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* test sortable list generation
|
||||
*
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
* @since CakePHP(tm) v 1.3
|
||||
|
@ -319,6 +319,7 @@ class JsHelperTestCase extends CakeTestCase {
|
|||
*/
|
||||
function testLinkWithMock() {
|
||||
$this->_useMock();
|
||||
|
||||
$options = array('update' => '#content');
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->any())
|
||||
|
@ -335,7 +336,7 @@ class JsHelperTestCase extends CakeTestCase {
|
|||
|
||||
$this->Js->TestJsEngine->expects($this->at(2))
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('event'), $this->equalTo( array('click', 'ajax code', $options)));
|
||||
->with($this->equalTo('event'), $this->equalTo( array('click', 'ajax code', $options + array('buffer' => null))));
|
||||
|
||||
$result = $this->Js->link('test link', '/posts/view/1', $options);
|
||||
$expected = array(
|
||||
|
@ -344,6 +345,15 @@ class JsHelperTestCase extends CakeTestCase {
|
|||
'/a'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* test link with a mock and confirmation
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLinkWithMockAndConfirm() {
|
||||
$this->_useMock();
|
||||
|
||||
$options = array(
|
||||
'confirm' => 'Are you sure?',
|
||||
|
@ -369,6 +379,7 @@ CODE;
|
|||
$this->Js->TestJsEngine->expects($this->at(1))
|
||||
->method('event')
|
||||
->with($this->equalTo('click'), $this->equalTo($code));
|
||||
|
||||
$result = $this->Js->link('test link »', '/posts/view/1', $options);
|
||||
$expected = array(
|
||||
'a' => array('id' => $options['id'], 'class' => $options['class'], 'href' => '/posts/view/1'),
|
||||
|
@ -376,6 +387,15 @@ CODE;
|
|||
'/a'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* test link passing on htmlAttributes
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLinkWithAribtraryAttributes() {
|
||||
$this->_useMock();
|
||||
|
||||
$options = array('id' => 'something', 'htmlAttributes' => array('arbitrary' => 'value', 'batman' => 'robin'));
|
||||
$result = $this->Js->link('test link', '/posts/view/1', $options);
|
||||
|
@ -395,14 +415,15 @@ CODE;
|
|||
*/
|
||||
function testLinkWithNoBuffering() {
|
||||
$this->_useMock();
|
||||
$this->Js->TestJsEngine->expects($this->any())
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->at(1))
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('request'))
|
||||
->with('request', array('/posts/view/1', array('update' => '#content')))
|
||||
->will($this->returnValue('ajax code'));
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->any())
|
||||
$this->Js->TestJsEngine->expects($this->at(2))
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('get'))
|
||||
->with('event')
|
||||
->will($this->returnValue('-event handler-'));
|
||||
|
||||
$options = array('update' => '#content', 'buffer' => false);
|
||||
|
@ -418,9 +439,29 @@ CODE;
|
|||
'/script'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* test link with buffering off and safe on.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testLinkWithNoBufferingAndSafe() {
|
||||
$this->_useMock();
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->at(1))
|
||||
->method('dispatchMethod')
|
||||
->with('request', array('/posts/view/1', array('update' => '#content')))
|
||||
->will($this->returnValue('ajax code'));
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->at(2))
|
||||
->method('dispatchMethod')
|
||||
->with('event')
|
||||
->will($this->returnValue('-event handler-'));
|
||||
|
||||
$options = array('update' => '#content', 'buffer' => false, 'safe' => false);
|
||||
$result = $this->Js->link('test link', '/posts/view/1', $options);
|
||||
|
||||
$expected = array(
|
||||
'a' => array('id' => 'preg:/link-\d+/', 'href' => '/posts/view/1'),
|
||||
'test link',
|
||||
|
@ -441,41 +482,29 @@ CODE;
|
|||
$this->_useMock();
|
||||
|
||||
$options = array('update' => '#content', 'id' => 'test-submit');
|
||||
$this->Js->TestJsEngine->expects($this->any())
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('serializeform'))
|
||||
->will($this->returnValue('serialize-code'));
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->any())
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('serializeForm'))
|
||||
->will($this->returnValue('serialize-code'));
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->any())
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('get'))
|
||||
->will($this->returnValue('ajax-code'));
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->at(0))
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('get'));
|
||||
->with('get');
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->at(1))
|
||||
->method('dispatchMethod')
|
||||
->with($this->matchesRegularExpression('/serializeForm/i'));
|
||||
->with('serializeForm')
|
||||
->will($this->returnValue('serialize-code'));
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->at(2))
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('request'));
|
||||
->with('request')
|
||||
->will($this->returnValue('ajax-code'));
|
||||
|
||||
$params = array(
|
||||
'update' => $options['update'], 'data' => 'serialize-code',
|
||||
'method' => 'post', 'dataExpression' => true
|
||||
'method' => 'post', 'dataExpression' => true, 'buffer' => null
|
||||
);
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->at(3))
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('event'), $this->equalTo( array('click', "ajax-code", $params)));
|
||||
->with('event', $this->equalTo( array('click', "ajax-code", $params)));
|
||||
|
||||
$result = $this->Js->submit('Save', $options);
|
||||
$expected = array(
|
||||
|
@ -487,7 +516,7 @@ CODE;
|
|||
|
||||
$this->Js->TestJsEngine->expects($this->at(4))
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('get'));
|
||||
->with('get');
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->at(5))
|
||||
->method('dispatchMethod')
|
||||
|
@ -508,7 +537,7 @@ CODE;
|
|||
|
||||
$params = array(
|
||||
'update' => '#content', 'data' => 'serialize-code',
|
||||
'method' => 'post', 'dataExpression' => true
|
||||
'method' => 'post', 'dataExpression' => true, 'buffer' => null
|
||||
);
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->at(7))
|
||||
|
@ -534,36 +563,28 @@ CODE;
|
|||
$this->_useMock();
|
||||
$options = array('update' => '#content', 'id' => 'test-submit', 'buffer' => false, 'safe' => false);
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->any())
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('serializeform'))
|
||||
->will($this->returnValue('serialize-code'));
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->any())
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('request'))
|
||||
->will($this->returnValue('ajax-code'));
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->any())
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('event'))
|
||||
->will($this->returnValue('event-handler'));
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->at(0))
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('get'));
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->at(1))
|
||||
->method('dispatchMethod')
|
||||
->with($this->matchesRegularExpression('/serializeForm/i'));
|
||||
->with('serializeForm')
|
||||
->will($this->returnValue('serialize-code'));
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->at(2))
|
||||
->method('dispatchMethod')
|
||||
->with($this->equalTo('request'));
|
||||
->with('request')
|
||||
->will($this->returnValue('ajax-code'));
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->at(3))
|
||||
->method('dispatchMethod')
|
||||
->with('event')
|
||||
->will($this->returnValue('event-handler'));
|
||||
|
||||
$params = array(
|
||||
'update' => $options['update'], 'buffer' => false, 'safe' => false, 'data' => 'serialize-code',
|
||||
'method' => 'post', 'dataExpression' => true
|
||||
'update' => $options['update'], 'data' => 'serialize-code',
|
||||
'method' => 'post', 'dataExpression' => true, 'buffer' => false
|
||||
);
|
||||
|
||||
$this->Js->TestJsEngine->expects($this->at(3))
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
@ -179,7 +179,6 @@ class PaginatorHelperTest extends CakeTestCase {
|
|||
$result = $this->Paginator->sort('title');
|
||||
$this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:asc" class="desc">Title<\/a>$/', $result);
|
||||
|
||||
|
||||
$this->Paginator->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc');
|
||||
$this->Paginator->params['paging']['Article']['options']['sort'] = null;
|
||||
$result = $this->Paginator->sort('title');
|
||||
|
@ -190,23 +189,71 @@ class PaginatorHelperTest extends CakeTestCase {
|
|||
$result = $this->Paginator->sort('Title', 'title', array('direction' => 'desc'));
|
||||
$this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:asc" class="desc">Title<\/a>$/', $result);
|
||||
|
||||
|
||||
$this->Paginator->params['paging']['Article']['options']['order'] = array('Article.title' => 'desc');
|
||||
$this->Paginator->params['paging']['Article']['options']['sort'] = null;
|
||||
$result = $this->Paginator->sort('Title', 'title', array('direction' => 'asc'));
|
||||
$this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:asc" class="desc">Title<\/a>$/', $result);
|
||||
|
||||
|
||||
$this->Paginator->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc');
|
||||
$this->Paginator->params['paging']['Article']['options']['sort'] = null;
|
||||
$result = $this->Paginator->sort('Title', 'title', array('direction' => 'asc'));
|
||||
$this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:desc" class="asc">Title<\/a>$/', $result);
|
||||
|
||||
|
||||
$this->Paginator->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc');
|
||||
$this->Paginator->params['paging']['Article']['options']['sort'] = null;
|
||||
$result = $this->Paginator->sort('Title', 'title', array('direction' => 'desc'));
|
||||
$this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:desc" class="asc">Title<\/a>$/', $result);
|
||||
|
||||
$this->Paginator->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc');
|
||||
$this->Paginator->params['paging']['Article']['options']['sort'] = null;
|
||||
$result = $this->Paginator->sort('Title', 'title', array('direction' => 'desc', 'class' => 'foo'));
|
||||
$this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:desc" class="foo asc">Title<\/a>$/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* test that sort() works with virtual field order options.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testSortLinkWithVirtualField() {
|
||||
Router::setRequestInfo(array(
|
||||
array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'form' => array(), 'url' => array('url' => 'accounts/')),
|
||||
array('base' => '', 'here' => '/accounts/', 'webroot' => '/')
|
||||
));
|
||||
$this->Paginator->params['paging']['Article']['options']['order'] = array('full_name' => 'asc');
|
||||
|
||||
$result = $this->Paginator->sort('Article.full_name');
|
||||
$expected = array(
|
||||
'a' => array('href' => '/accounts/index/page:1/sort:Article.full_name/direction:desc', 'class' => 'asc'),
|
||||
'Article.full Name',
|
||||
'/a'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
|
||||
$result = $this->Paginator->sort('full_name');
|
||||
$expected = array(
|
||||
'a' => array('href' => '/accounts/index/page:1/sort:full_name/direction:desc', 'class' => 'asc'),
|
||||
'Full Name',
|
||||
'/a'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
|
||||
$this->Paginator->params['paging']['Article']['options']['order'] = array('full_name' => 'desc');
|
||||
$result = $this->Paginator->sort('Article.full_name');
|
||||
$expected = array(
|
||||
'a' => array('href' => '/accounts/index/page:1/sort:Article.full_name/direction:asc', 'class' => 'desc'),
|
||||
'Article.full Name',
|
||||
'/a'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
|
||||
$result = $this->Paginator->sort('full_name');
|
||||
$expected = array(
|
||||
'a' => array('href' => '/accounts/index/page:1/sort:full_name/direction:asc', 'class' => 'desc'),
|
||||
'Full Name',
|
||||
'/a'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.view.helpers
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The Open Group Test Suite License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs
|
||||
* @since CakePHP(tm) v 1.2.0.5432
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue