mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 08:58:25 +00:00
Merge remote branch 'origin/1.3' into 2.0
Conflicts: cake/basics.php cake/console/libs/shell.php cake/console/libs/tasks/controller.php cake/libs/controller/components/request_handler.php cake/libs/model/model.php cake/libs/model/model_behavior.php cake/libs/overloadable.php cake/libs/overloadable_php4.php cake/libs/overloadable_php5.php cake/libs/sanitize.php cake/libs/validation.php cake/libs/view/helpers/ajax.php cake/libs/view/helpers/javascript.php cake/libs/view/pages/home.ctp cake/tests/cases/console/libs/tasks/controller.test.php cake/tests/cases/libs/overloadable.test.php cake/tests/cases/libs/validation.test.php cake/tests/cases/libs/view/helpers/ajax.test.php cake/tests/cases/libs/view/helpers/javascript.test.php cake/tests/test_app/libs/cache/test_app_cache.php cake/tests/test_app/plugins/test_plugin/libs/cache/test_plugin_cache.php cake/tests/test_app/plugins/test_plugin/models/test_plugin_auth_user.php cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php
This commit is contained in:
commit
6a18b2bc1d
275 changed files with 884 additions and 642 deletions
|
@ -157,6 +157,11 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of CakePHP's session cookie.
|
* 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');
|
Configure::write('Session.cookie', 'CAKEPHP');
|
||||||
|
|
||||||
|
@ -183,8 +188,8 @@
|
||||||
* Valid values:
|
* Valid values:
|
||||||
*
|
*
|
||||||
* 'high' Session timeout in 'Session.timeout' x 10
|
* 'high' Session timeout in 'Session.timeout' x 10
|
||||||
* 'medium' Session timeout in 'Session.timeout' x 100
|
* 'medium' Session timeout in 'Session.timeout' x 5040
|
||||||
* 'low' Session timeout in 'Session.timeout' x 300
|
* 'low' Session timeout in 'Session.timeout' x 2628000
|
||||||
*
|
*
|
||||||
* CakePHP session IDs are also regenerated between requests if
|
* CakePHP session IDs are also regenerated between requests if
|
||||||
* 'Security.level' is set to 'high'.
|
* 'Security.level' is set to 'high'.
|
||||||
|
|
|
@ -4,16 +4,16 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.cake.tests.libs
|
* @subpackage cake.app.webroot
|
||||||
* @since CakePHP(tm) v 1.2.0.4433
|
* @since CakePHP(tm) v 1.2.0.4433
|
||||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -432,7 +432,7 @@ class ShellDispatcher {
|
||||||
$printOptions = '(' . implode('/', $options) . ')';
|
$printOptions = '(' . implode('/', $options) . ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($default == null) {
|
if ($default === null) {
|
||||||
$this->stdout($prompt . " $printOptions \n" . '> ', false);
|
$this->stdout($prompt . " $printOptions \n" . '> ', false);
|
||||||
} else {
|
} else {
|
||||||
$this->stdout($prompt . " $printOptions \n" . "[$default] > ", false);
|
$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
|
* @return string Singular model key
|
||||||
*/
|
*/
|
||||||
protected function _modelKey($name) {
|
protected function _modelKey($name) {
|
||||||
return Inflector::underscore(Inflector::singularize($name)) . '_id';
|
return Inflector::underscore($name) . '_id';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -57,7 +57,7 @@ class ControllerTask extends BakeTask {
|
||||||
*/
|
*/
|
||||||
public function execute() {
|
public function execute() {
|
||||||
if (empty($this->args)) {
|
if (empty($this->args)) {
|
||||||
$this->_interactive();
|
return $this->_interactive();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->args[0])) {
|
if (isset($this->args[0])) {
|
||||||
|
@ -175,7 +175,7 @@ class ControllerTask extends BakeTask {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
list($wannaBakeCrud, $wannaBakeCrud) = $this->_askAboutMethods();
|
list($wannaBakeCrud, $wannaBakeAdminCrud) = $this->_askAboutMethods();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strtolower($wannaBakeCrud) == 'y') {
|
if (strtolower($wannaBakeCrud) == 'y') {
|
||||||
|
@ -186,6 +186,7 @@ class ControllerTask extends BakeTask {
|
||||||
$actions .= $this->bakeActions($controllerName, $admin, strtolower($wannaUseSession) == 'y');
|
$actions .= $this->bakeActions($controllerName, $admin, strtolower($wannaUseSession) == 'y');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$baked = false;
|
||||||
if ($this->interactive === true) {
|
if ($this->interactive === true) {
|
||||||
$this->confirmController($controllerName, $useDynamicScaffold, $helpers, $components);
|
$this->confirmController($controllerName, $useDynamicScaffold, $helpers, $components);
|
||||||
$looksGood = $this->in(__('Look okay?'), array('y','n'), 'y');
|
$looksGood = $this->in(__('Look okay?'), array('y','n'), 'y');
|
||||||
|
@ -202,6 +203,7 @@ class ControllerTask extends BakeTask {
|
||||||
$this->bakeTest($controllerName);
|
$this->bakeTest($controllerName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return $baked;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -282,7 +284,7 @@ class ControllerTask extends BakeTask {
|
||||||
$controllerPath = $this->_controllerPath($controllerName);
|
$controllerPath = $this->_controllerPath($controllerName);
|
||||||
$pluralName = $this->_pluralName($currentModelName);
|
$pluralName = $this->_pluralName($currentModelName);
|
||||||
$singularName = Inflector::variable($currentModelName);
|
$singularName = Inflector::variable($currentModelName);
|
||||||
$singularHumanName = $this->_singularHumanName($currentModelName);
|
$singularHumanName = $this->_singularHumanName($controllerName);
|
||||||
$pluralHumanName = $this->_pluralName($controllerName);
|
$pluralHumanName = $this->_pluralName($controllerName);
|
||||||
|
|
||||||
$this->Template->set(compact('admin', 'controllerPath', 'pluralName', 'singularName', 'singularHumanName',
|
$this->Template->set(compact('admin', 'controllerPath', 'pluralName', 'singularName', 'singularHumanName',
|
||||||
|
|
|
@ -54,7 +54,7 @@ class TemplateTask extends Shell {
|
||||||
protected function _findThemes() {
|
protected function _findThemes() {
|
||||||
$paths = App::path('shells');
|
$paths = App::path('shells');
|
||||||
$core = array_pop($paths);
|
$core = array_pop($paths);
|
||||||
$core = str_replace('libs' . DS, '', $core);
|
$core = preg_replace('#libs' . DS . '$#', '', $core);
|
||||||
$paths[] = $core;
|
$paths[] = $core;
|
||||||
$Folder =& new Folder($core . 'templates' . DS . 'default');
|
$Folder =& new Folder($core . 'templates' . DS . 'default');
|
||||||
$contents = $Folder->read();
|
$contents = $Folder->read();
|
||||||
|
|
|
@ -94,14 +94,12 @@ class TestTask extends BakeTask {
|
||||||
$this->out(sprintf(__('Path: %s'), $this->path));
|
$this->out(sprintf(__('Path: %s'), $this->path));
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
|
||||||
$selection = null;
|
|
||||||
if ($type) {
|
if ($type) {
|
||||||
$type = Inflector::camelize($type);
|
$type = Inflector::camelize($type);
|
||||||
if (!in_array($type, $this->classTypes)) {
|
if (!in_array($type, $this->classTypes)) {
|
||||||
unset($type);
|
$this->error(sprintf('Incorrect type provided. Please choose one of %s', implode(', ', $this->classTypes)));
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
if (!$type) {
|
|
||||||
$type = $this->getObjectType();
|
$type = $this->getObjectType();
|
||||||
}
|
}
|
||||||
$className = $this->getClassName($type);
|
$className = $this->getClassName($type);
|
||||||
|
|
|
@ -195,6 +195,7 @@ class ViewTask extends BakeTask {
|
||||||
$actions = $this->_methodsToBake();
|
$actions = $this->_methodsToBake();
|
||||||
}
|
}
|
||||||
$this->bakeActions($actions, $vars);
|
$this->bakeActions($actions, $vars);
|
||||||
|
$actions = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -290,7 +291,7 @@ class ViewTask extends BakeTask {
|
||||||
$primaryKey = $modelObj->primaryKey;
|
$primaryKey = $modelObj->primaryKey;
|
||||||
$displayField = $modelObj->displayField;
|
$displayField = $modelObj->displayField;
|
||||||
$singularVar = Inflector::variable($modelClass);
|
$singularVar = Inflector::variable($modelClass);
|
||||||
$singularHumanName = $this->_singularHumanName($modelClass);
|
$singularHumanName = $this->_singularHumanName($this->controllerName);
|
||||||
$schema = $modelObj->schema(true);
|
$schema = $modelObj->schema(true);
|
||||||
$fields = array_keys($schema);
|
$fields = array_keys($schema);
|
||||||
$associations = $this->__associations($modelObj);
|
$associations = $this->__associations($modelObj);
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs
|
* @subpackage cake.cake.console.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4433
|
* @since CakePHP(tm) v 1.2.0.4433
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.cake.tests.libs
|
* @subpackage cake.cake.tests.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4433
|
* @since CakePHP(tm) v 1.2.0.4433
|
||||||
|
|
|
@ -130,6 +130,14 @@ class CakeSession extends Object {
|
||||||
*/
|
*/
|
||||||
public $host = null;
|
public $host = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Session timeout multiplier factor
|
||||||
|
*
|
||||||
|
* @var ineteger
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
var $timeout = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -455,20 +463,20 @@ class CakeSession extends Object {
|
||||||
|
|
||||||
switch ($this->security) {
|
switch ($this->security) {
|
||||||
case 'high':
|
case 'high':
|
||||||
$this->cookieLifeTime = 0;
|
$this->cookieLifeTime = Configure::read('Session.timeout') * Security::inactiveMins();
|
||||||
if ($iniSet) {
|
if ($iniSet) {
|
||||||
ini_set('session.referer_check', $this->host);
|
ini_set('session.referer_check', $this->host);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'medium':
|
case 'medium':
|
||||||
$this->cookieLifeTime = 7 * 86400;
|
$this->cookieLifeTime = Configure::read('Session.timeout') * Security::inactiveMins();
|
||||||
if ($iniSet) {
|
if ($iniSet) {
|
||||||
ini_set('session.referer_check', $this->host);
|
ini_set('session.referer_check', $this->host);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'low':
|
case 'low':
|
||||||
default:
|
default:
|
||||||
$this->cookieLifeTime = 788940000;
|
$this->cookieLifeTime = Configure::read('Session.timeout') * Security::inactiveMins();
|
||||||
break;
|
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')) {
|
if ((Configure::read('Session.checkAgent') === false || $this->_userAgent == $this->read('Config.userAgent')) && $this->time <= $this->read('Config.time')) {
|
||||||
$time = $this->read('Config.time');
|
$time = $this->read('Config.time');
|
||||||
$this->write('Config.time', $this->sessionTime);
|
$this->write('Config.time', $this->sessionTime);
|
||||||
|
|
||||||
if (Configure::read('Security.level') === 'high') {
|
if (Configure::read('Security.level') === 'high') {
|
||||||
$check = $this->read('Config.timeout');
|
$check = $this->read('Config.timeout');
|
||||||
$check = $check - 1;
|
$check -= 1;
|
||||||
$this->write('Config.timeout', $check);
|
$this->write('Config.timeout', $check);
|
||||||
|
|
||||||
if (time() > ($time - (Security::inactiveMins() * Configure::read('Session.timeout')) + 2) || $check < 1) {
|
if (time() > ($time - (Security::inactiveMins() * Configure::read('Session.timeout')) + 2) || $check < 1) {
|
||||||
$this->renew();
|
$this->renew();
|
||||||
$this->write('Config.timeout', 10);
|
$this->write('Config.timeout', Security::inactiveMins());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->valid = true;
|
$this->valid = true;
|
||||||
|
@ -611,7 +618,7 @@ class CakeSession extends Object {
|
||||||
} else {
|
} else {
|
||||||
$this->write('Config.userAgent', $this->_userAgent);
|
$this->write('Config.userAgent', $this->_userAgent);
|
||||||
$this->write('Config.time', $this->sessionTime);
|
$this->write('Config.time', $this->sessionTime);
|
||||||
$this->write('Config.timeout', 10);
|
$this->write('Config.timeout', Security::inactiveMins());
|
||||||
$this->valid = true;
|
$this->valid = true;
|
||||||
$this->__setError(1, 'Session is valid');
|
$this->__setError(1, 'Session is valid');
|
||||||
}
|
}
|
||||||
|
@ -738,21 +745,7 @@ class CakeSession extends Object {
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __write($id, $data) {
|
function __write($id, $data) {
|
||||||
switch (Configure::read('Security.level')) {
|
$expires = time() + Configure::read('Session.timeout') * Security::inactiveMins();
|
||||||
case 'medium':
|
|
||||||
$factor = 100;
|
|
||||||
break;
|
|
||||||
case 'low':
|
|
||||||
$factor = 300;
|
|
||||||
break;
|
|
||||||
case 'high':
|
|
||||||
default:
|
|
||||||
$factor = 10;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$expires = time() + Configure::read('Session.timeout') * $factor;
|
|
||||||
|
|
||||||
$model =& ClassRegistry::getObject('Session');
|
$model =& ClassRegistry::getObject('Session');
|
||||||
$return = $model->save(compact('id', 'data', 'expires'));
|
$return = $model->save(compact('id', 'data', 'expires'));
|
||||||
return $return;
|
return $return;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
*
|
*
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.libs.controller
|
* @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 {
|
class Component extends Object {
|
||||||
|
|
||||||
|
|
|
@ -258,8 +258,9 @@ class RequestHandlerComponent extends Object {
|
||||||
*
|
*
|
||||||
* @param object $controller A reference to the controller
|
* @param object $controller A reference to the controller
|
||||||
* @param mixed $url A string or array containing the redirect location
|
* @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()) {
|
if (!$this->isAjax()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -269,6 +270,12 @@ class RequestHandlerComponent extends Object {
|
||||||
if (is_array($url)) {
|
if (is_array($url)) {
|
||||||
$url = Router::url($url + array('base' => false));
|
$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'));
|
echo $this->requestAction($url, array('return'));
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,6 @@ class SecurityComponent extends Object {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An associative array of usernames/passwords used for HTTP-authenticated logins.
|
* An associative array of usernames/passwords used for HTTP-authenticated logins.
|
||||||
* If using digest authentication, passwords should be MD5-hashed.
|
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @access public
|
* @access public
|
||||||
|
|
|
@ -172,6 +172,7 @@ class L10n {
|
||||||
/* Urdu */ 'urd' => 'ur',
|
/* Urdu */ 'urd' => 'ur',
|
||||||
/* Venda */ 'ven' => 've',
|
/* Venda */ 'ven' => 've',
|
||||||
/* Vietnamese */ 'vie' => 'vi',
|
/* Vietnamese */ 'vie' => 'vi',
|
||||||
|
/* Welsh */ 'cym' => 'cy',
|
||||||
/* Xhosa */ 'xho' => 'xh',
|
/* Xhosa */ 'xho' => 'xh',
|
||||||
/* Yiddish */ 'yid' => 'yi',
|
/* Yiddish */ 'yid' => 'yi',
|
||||||
/* Zulu */ 'zul' => 'zu');
|
/* Zulu */ 'zul' => 'zu');
|
||||||
|
@ -315,6 +316,7 @@ class L10n {
|
||||||
'ur' => array('language' => 'Urdu', 'locale' => 'urd', 'localeFallback' => 'urd', 'charset' => 'utf-8', 'direction' => 'rtl'),
|
'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'),
|
'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'),
|
'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'),
|
'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'),
|
'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'),
|
'zh' => array('language' => 'Chinese', 'locale' => 'chi', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr'),
|
||||||
|
|
|
@ -726,8 +726,8 @@ class DboMysql extends DboMysqlBase {
|
||||||
$j = 0;
|
$j = 0;
|
||||||
|
|
||||||
while ($j < $numFields) {
|
while ($j < $numFields) {
|
||||||
$column = mysql_fetch_field($results,$j);
|
$column = mysql_fetch_field($results, $j);
|
||||||
if (!empty($column->table)) {
|
if (!empty($column->table) && strpos($column->name, '__') === false) {
|
||||||
$this->map[$index++] = array($column->table, $column->name);
|
$this->map[$index++] = array($column->table, $column->name);
|
||||||
} else {
|
} else {
|
||||||
$this->map[$index++] = array(0, $column->name);
|
$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]);
|
unset($this->data[$this->alias][$this->primaryKey]);
|
||||||
}
|
}
|
||||||
$fields = $values = array();
|
$fields = $values = array();
|
||||||
|
|
|
@ -361,6 +361,7 @@ class BehaviorCollection extends Object {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function detach($name) {
|
public function detach($name) {
|
||||||
|
list($plugin, $name) = pluginSplit($name);
|
||||||
if (isset($this->{$name})) {
|
if (isset($this->{$name})) {
|
||||||
$this->{$name}->cleanup(ClassRegistry::getObject($this->modelName));
|
$this->{$name}->cleanup(ClassRegistry::getObject($this->modelName));
|
||||||
unset($this->{$name});
|
unset($this->{$name});
|
||||||
|
|
|
@ -156,7 +156,7 @@ class Sanitize {
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
public static function stripScripts($str) {
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -380,14 +380,14 @@ class Validation {
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($return === true && preg_match('/@(' . self::$__pattern['hostname'] . ')$/i', $check, $regs)) {
|
if ($return === true && preg_match('/@(' . self::__pattern['hostname'] . ')$/i', $check, $regs)) {
|
||||||
$host = gethostbynamel($regs[1]);
|
if (function_exists('getmxrr') && getmxrr($regs[1], $mxhosts)) {
|
||||||
$return = is_array($host);
|
return true;
|
||||||
$isWindows = (DIRECTORY_SEPARATOR === '\\');
|
|
||||||
if (!$isWindows || (version_compare(PHP_VERSION, '5.3.0', '>=') && $isWindows)) {
|
|
||||||
$return = $return && getmxrr($regs[1], $mxhosts);
|
|
||||||
}
|
}
|
||||||
return $return;
|
if (function_exists('checkdnsrr') && checkdnsrr($regs[1], 'MX')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return is_array(gethostbynamel($regs[1]));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,7 +211,7 @@ class FormHelper extends AppHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$object =& $this->_introspectModel($model);
|
$object = $this->_introspectModel($model);
|
||||||
$this->setEntity($model . '.', true);
|
$this->setEntity($model . '.', true);
|
||||||
|
|
||||||
$modelEntity = $this->model();
|
$modelEntity = $this->model();
|
||||||
|
|
|
@ -252,9 +252,13 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
||||||
if (isset($options['update'])) {
|
if (isset($options['update'])) {
|
||||||
$wrapCallbacks = isset($options['wrapCallbacks']) ? $options['wrapCallbacks'] : true;
|
$wrapCallbacks = isset($options['wrapCallbacks']) ? $options['wrapCallbacks'] : true;
|
||||||
if ($wrapCallbacks) {
|
if ($wrapCallbacks) {
|
||||||
$success = '$("' . $options['update'] . '").html(data);';
|
$success = $this->jQueryObject . '("' . $options['update'] . '").html(data);';
|
||||||
} else {
|
} 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['dataType'] = 'html';
|
||||||
$options['success'] = $success;
|
$options['success'] = $success;
|
||||||
|
@ -267,7 +271,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
||||||
}
|
}
|
||||||
$options = $this->_prepareCallbacks('request', $options);
|
$options = $this->_prepareCallbacks('request', $options);
|
||||||
$options = $this->_parseOptions($options, $callbacks);
|
$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);
|
list($options, $htmlOptions) = $this->_getHtmlOptions($options);
|
||||||
$out = $this->Html->link($title, $url, $htmlOptions);
|
$out = $this->Html->link($title, $url, $htmlOptions);
|
||||||
$this->get('#' . $htmlOptions['id']);
|
$this->get('#' . $htmlOptions['id']);
|
||||||
$requestString = '';
|
$requestString = $event = '';
|
||||||
if (isset($options['confirm'])) {
|
if (isset($options['confirm'])) {
|
||||||
$requestString = $this->confirmReturn($options['confirm']);
|
$requestString = $this->confirmReturn($options['confirm']);
|
||||||
unset($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);
|
$requestString .= $this->request($url, $options);
|
||||||
|
|
||||||
if (!empty($requestString)) {
|
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) {
|
if (isset($buffer) && !$buffer) {
|
||||||
$opts = array_intersect_key(array('safe' => null), $options);
|
$opts = array('safe' => $safe);
|
||||||
$out .= $this->Html->scriptBlock($event, $opts);
|
$out .= $this->Html->scriptBlock($event, $opts);
|
||||||
}
|
}
|
||||||
return $out;
|
return $out;
|
||||||
|
@ -351,8 +356,16 @@ class JsHelper extends AppHelper {
|
||||||
* Forms submitting with this method, cannot send files. Files do not transfer over XmlHttpRequest
|
* Forms submitting with this method, cannot send files. Files do not transfer over XmlHttpRequest
|
||||||
* and require an iframe or flash.
|
* 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 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.
|
* @return string Completed submit button.
|
||||||
*/
|
*/
|
||||||
public function submit($caption = null, $options = array()) {
|
public function submit($caption = null, $options = array()) {
|
||||||
|
@ -379,12 +392,17 @@ class JsHelper extends AppHelper {
|
||||||
$options['method'] = 'post';
|
$options['method'] = 'post';
|
||||||
}
|
}
|
||||||
$options['dataExpression'] = true;
|
$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);
|
$requestString .= $this->request($url, $options);
|
||||||
if (!empty($requestString)) {
|
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) {
|
if (isset($buffer) && !$buffer) {
|
||||||
$opts = array_intersect_key(array('safe' => null), $options);
|
$opts = array('safe' => $safe);
|
||||||
$out .= $this->Html->scriptBlock($event, $opts);
|
$out .= $this->Html->scriptBlock($event, $opts);
|
||||||
}
|
}
|
||||||
return $out;
|
return $out;
|
||||||
|
|
|
@ -191,18 +191,10 @@ class PaginatorHelper extends AppHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($options['sort']) && !empty($options['sort'])) {
|
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'];
|
return $options['sort'];
|
||||||
} elseif (isset($options['order']) && is_array($options['order'])) {
|
} elseif (isset($options['order']) && is_array($options['order'])) {
|
||||||
return key($options['order']);
|
return key($options['order']);
|
||||||
} elseif (isset($options['order']) && is_string($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 $options['order'];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -303,13 +295,18 @@ class PaginatorHelper extends AppHelper {
|
||||||
unset($options['direction']);
|
unset($options['direction']);
|
||||||
|
|
||||||
$sortKey = $this->sortKey($options['model']);
|
$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) {
|
if ($isSorted) {
|
||||||
$dir = $this->sortDir($options['model']) === 'asc' ? 'desc' : 'asc';
|
$dir = $this->sortDir($options['model']) === 'asc' ? 'desc' : 'asc';
|
||||||
$class = $dir === 'asc' ? 'desc' : 'asc';
|
$class = $dir === 'asc' ? 'desc' : 'asc';
|
||||||
if (!empty($options['class'])) {
|
if (!empty($options['class'])) {
|
||||||
$options['class'] .= $class;
|
$options['class'] .= ' ' . $class;
|
||||||
} else {
|
} else {
|
||||||
$options['class'] = $class;
|
$options['class'] = $class;
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,8 +106,8 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
echo $this->Html->link(
|
echo $this->Html->link(
|
||||||
sprintf('<strong>%s</strong>%s', __('new'), __('CakePHP 1.2 Docs')),
|
sprintf('<strong>%s</strong>%s', __('new'), __('CakePHP 1.3 Docs')),
|
||||||
'http://book.cakephp.org',
|
'http://book.cakephp.org/view/875/x1-3-Collection',
|
||||||
array('target' => '_blank', 'escape' => false)
|
array('target' => '_blank', 'escape' => false)
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases
|
* @subpackage cake.tests.cases
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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.
|
* Copyright 2005-2010, Cake Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc.
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.console
|
* @subpackage cake.tests.cases.console
|
||||||
* @since CakePHP(tm) v 1.2.0.5432
|
* @since CakePHP(tm) v 1.2.0.5432
|
||||||
|
|
|
@ -310,20 +310,20 @@ class ControllerTaskTest extends CakeTestCase {
|
||||||
$this->assertTrue(strpos($result, "\$this->set('articles', \$this->paginate());") !== false);
|
$this->assertTrue(strpos($result, "\$this->set('articles', \$this->paginate());") !== false);
|
||||||
|
|
||||||
$this->assertTrue(strpos($result, 'function view($id = null)') !== false);
|
$this->assertTrue(strpos($result, 'function view($id = null)') !== false);
|
||||||
$this->assertTrue(strpos($result, "\$this->Session->setFlash(sprintf(__('Invalid %s'), 'article'));") !== false);
|
$this->assertTrue(strpos($result, "\$this->Session->setFlash(__('Invalid article'));") !== false);
|
||||||
$this->assertTrue(strpos($result, "\$this->set('article', \$this->Article->read(null, \$id)") !== false);
|
$this->assertTrue(strpos($result, "\$this->set('article', \$this->Article->read(null, \$id)") !== false);
|
||||||
|
|
||||||
$this->assertTrue(strpos($result, 'function add()') !== false);
|
$this->assertTrue(strpos($result, 'function add()') !== false);
|
||||||
$this->assertTrue(strpos($result, 'if (!empty($this->data))') !== false);
|
$this->assertTrue(strpos($result, 'if (!empty($this->data))') !== false);
|
||||||
$this->assertTrue(strpos($result, 'if ($this->Article->save($this->data))') !== false);
|
$this->assertTrue(strpos($result, 'if ($this->Article->save($this->data))') !== false);
|
||||||
$this->assertTrue(strpos($result, "\$this->Session->setFlash(sprintf(__('The %s has been saved'), 'article'));") !== false);
|
$this->assertTrue(strpos($result, "\$this->Session->setFlash(__('The article has been saved'));") !== false);
|
||||||
|
|
||||||
$this->assertTrue(strpos($result, 'function edit($id = null)') !== false);
|
$this->assertTrue(strpos($result, 'function edit($id = null)') !== false);
|
||||||
$this->assertTrue(strpos($result, "\$this->Session->setFlash(sprintf(__('The %s could not be saved. Please, try again.'), 'article'));") !== false);
|
$this->assertTrue(strpos($result, "\$this->Session->setFlash(__('The article could not be saved. Please, try again.'));") !== false);
|
||||||
|
|
||||||
$this->assertTrue(strpos($result, 'function delete($id = null)') !== false);
|
$this->assertTrue(strpos($result, 'function delete($id = null)') !== false);
|
||||||
$this->assertTrue(strpos($result, 'if ($this->Article->delete($id))') !== false);
|
$this->assertTrue(strpos($result, 'if ($this->Article->delete($id))') !== false);
|
||||||
$this->assertTrue(strpos($result, "\$this->Session->setFlash(sprintf(__('%s deleted'), 'Article'));") !== false);
|
$this->assertTrue(strpos($result, "\$this->Session->setFlash(__('Article deleted'));") !== false);
|
||||||
|
|
||||||
$result = $this->Task->bakeActions('Articles', 'admin_', true);
|
$result = $this->Task->bakeActions('Articles', 'admin_', true);
|
||||||
|
|
||||||
|
@ -352,13 +352,13 @@ class ControllerTaskTest extends CakeTestCase {
|
||||||
$this->assertTrue(strpos($result, "\$this->set('articles', \$this->paginate());") !== false);
|
$this->assertTrue(strpos($result, "\$this->set('articles', \$this->paginate());") !== false);
|
||||||
|
|
||||||
$this->assertTrue(strpos($result, 'function view($id = null)') !== false);
|
$this->assertTrue(strpos($result, 'function view($id = null)') !== false);
|
||||||
$this->assertTrue(strpos($result, "\$this->flash(sprintf(__('Invalid %s'), 'article'), array('action' => 'index'))") !== false);
|
$this->assertTrue(strpos($result, "\$this->flash(__('Invalid article'), array('action' => 'index'))") !== false);
|
||||||
$this->assertTrue(strpos($result, "\$this->set('article', \$this->Article->read(null, \$id)") !== false);
|
$this->assertTrue(strpos($result, "\$this->set('article', \$this->Article->read(null, \$id)") !== false);
|
||||||
|
|
||||||
$this->assertTrue(strpos($result, 'function add()') !== false);
|
$this->assertTrue(strpos($result, 'function add()') !== false);
|
||||||
$this->assertTrue(strpos($result, 'if (!empty($this->data))') !== false);
|
$this->assertTrue(strpos($result, 'if (!empty($this->data))') !== false);
|
||||||
$this->assertTrue(strpos($result, 'if ($this->Article->save($this->data))') !== false);
|
$this->assertTrue(strpos($result, 'if ($this->Article->save($this->data))') !== false);
|
||||||
$this->assertTrue(strpos($result, "\$this->flash(sprintf(__('The %s has been saved.'), 'article'), array('action' => 'index'))") !== false);
|
$this->assertTrue(strpos($result, "\$this->flash(__('The article has been saved.'), array('action' => 'index'))") !== false);
|
||||||
|
|
||||||
$this->assertTrue(strpos($result, 'function edit($id = null)') !== false);
|
$this->assertTrue(strpos($result, 'function edit($id = null)') !== false);
|
||||||
$this->assertTrue(strpos($result, "\$this->Article->Tag->find('list')") !== false);
|
$this->assertTrue(strpos($result, "\$this->Article->Tag->find('list')") !== false);
|
||||||
|
@ -366,7 +366,7 @@ class ControllerTaskTest extends CakeTestCase {
|
||||||
|
|
||||||
$this->assertTrue(strpos($result, 'function delete($id = null)') !== false);
|
$this->assertTrue(strpos($result, 'function delete($id = null)') !== false);
|
||||||
$this->assertTrue(strpos($result, 'if ($this->Article->delete($id))') !== false);
|
$this->assertTrue(strpos($result, 'if ($this->Article->delete($id))') !== false);
|
||||||
$this->assertTrue(strpos($result, "\$this->flash(sprintf(__('%s deleted'), 'Article'), array('action' => 'index'))") !== false);
|
$this->assertTrue(strpos($result, "\$this->flash(__('Article deleted'), array('action' => 'index'))") !== false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -411,6 +411,35 @@ class ControllerTaskTest extends CakeTestCase {
|
||||||
$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticlesController/')));
|
$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticlesController/')));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test Interactive mode.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public function testInteractiveAdminMethodsNotInteractive() {
|
||||||
|
$this->Task->connection = 'test_suite';
|
||||||
|
$this->Task->interactive = true;
|
||||||
|
$this->Task->path = '/my/path';
|
||||||
|
$this->Task->setReturnValue('in', '1');
|
||||||
|
$this->Task->setReturnValueAt(1, 'in', 'y'); // build interactive
|
||||||
|
$this->Task->setReturnValueAt(2, 'in', 'n'); // build no scaffolds
|
||||||
|
$this->Task->setReturnValueAt(3, 'in', 'y'); // build normal methods
|
||||||
|
$this->Task->setReturnValueAt(4, 'in', 'y'); // build admin methods
|
||||||
|
$this->Task->setReturnValueAt(5, 'in', 'n'); // helpers?
|
||||||
|
$this->Task->setReturnValueAt(6, 'in', 'n'); // components?
|
||||||
|
$this->Task->setReturnValueAt(7, 'in', 'y'); // use sessions
|
||||||
|
$this->Task->setReturnValueAt(8, 'in', 'y'); // looks good
|
||||||
|
$this->Task->setReturnValue('createFile', true);
|
||||||
|
$this->Task->Project->setReturnValue('getPrefix', 'admin_');
|
||||||
|
|
||||||
|
$result = $this->Task->execute();
|
||||||
|
$this->assertPattern('/admin_index/', $result);
|
||||||
|
|
||||||
|
$filename = '/my/path/articles_controller.php';
|
||||||
|
$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticlesController/')));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test that execute runs all when the first arg == all
|
* test that execute runs all when the first arg == all
|
||||||
*
|
*
|
||||||
|
|
|
@ -286,10 +286,10 @@ class ViewTaskTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$result = $this->Task->getContent('view', $vars);
|
$result = $this->Task->getContent('view', $vars);
|
||||||
|
|
||||||
$this->assertPattern('/Delete .+Test View Model/', $result);
|
$this->assertPattern('/Delete Test View Model/', $result);
|
||||||
$this->assertPattern('/Edit .+Test View Model/', $result);
|
$this->assertPattern('/Edit Test View Model/', $result);
|
||||||
$this->assertPattern('/List .+Test View Models/', $result);
|
$this->assertPattern('/List Test View Models/', $result);
|
||||||
$this->assertPattern('/New .+Test View Model/', $result);
|
$this->assertPattern('/New Test View Model/', $result);
|
||||||
|
|
||||||
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'id\'\]/', $result);
|
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'id\'\]/', $result);
|
||||||
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result);
|
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result);
|
||||||
|
@ -318,10 +318,10 @@ class ViewTaskTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$result = $this->Task->getContent('admin_view', $vars);
|
$result = $this->Task->getContent('admin_view', $vars);
|
||||||
|
|
||||||
$this->assertPattern('/Delete .+Test View Model/', $result);
|
$this->assertPattern('/Delete Test View Model/', $result);
|
||||||
$this->assertPattern('/Edit .+Test View Model/', $result);
|
$this->assertPattern('/Edit Test View Model/', $result);
|
||||||
$this->assertPattern('/List .+Test View Models/', $result);
|
$this->assertPattern('/List Test View Models/', $result);
|
||||||
$this->assertPattern('/New .+Test View Model/', $result);
|
$this->assertPattern('/New Test View Model/', $result);
|
||||||
|
|
||||||
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'id\'\]/', $result);
|
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'id\'\]/', $result);
|
||||||
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result);
|
$this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result);
|
||||||
|
@ -330,7 +330,7 @@ class ViewTaskTest extends CakeTestCase {
|
||||||
$result = $this->Task->getContent('admin_add', $vars);
|
$result = $this->Task->getContent('admin_add', $vars);
|
||||||
$this->assertPattern("/input\('name'\)/", $result);
|
$this->assertPattern("/input\('name'\)/", $result);
|
||||||
$this->assertPattern("/input\('body'\)/", $result);
|
$this->assertPattern("/input\('body'\)/", $result);
|
||||||
$this->assertPattern('/List .+Test View Models/', $result);
|
$this->assertPattern('/List Test View Models/', $result);
|
||||||
|
|
||||||
Configure::write('Routing', $_back);
|
Configure::write('Routing', $_back);
|
||||||
}
|
}
|
||||||
|
@ -390,7 +390,7 @@ class ViewTaskTest extends CakeTestCase {
|
||||||
));
|
));
|
||||||
$this->Task->expectAt(1, 'createFile', array(
|
$this->Task->expectAt(1, 'createFile', array(
|
||||||
TMP . 'view_task_comments' . DS . 'edit.ctp',
|
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(
|
$this->Task->expectAt(2, 'createFile', array(
|
||||||
TMP . 'view_task_comments' . DS . 'index.ctp',
|
TMP . 'view_task_comments' . DS . 'index.ctp',
|
||||||
|
@ -552,11 +552,11 @@ class ViewTaskTest extends CakeTestCase {
|
||||||
));
|
));
|
||||||
$this->Task->expectAt(2, 'createFile', array(
|
$this->Task->expectAt(2, 'createFile', array(
|
||||||
TMP . 'view_task_comments' . DS . 'add.ctp',
|
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(
|
$this->Task->expectAt(3, 'createFile', array(
|
||||||
TMP . 'view_task_comments' . DS . 'edit.ctp',
|
TMP . 'view_task_comments' . DS . 'edit.ctp',
|
||||||
new PatternExpectation('/Edit .+View Task Comment/')
|
new PatternExpectation('/Edit View Task Comment/')
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->Task->execute();
|
$this->Task->execute();
|
||||||
|
@ -607,11 +607,11 @@ class ViewTaskTest extends CakeTestCase {
|
||||||
));
|
));
|
||||||
$this->Task->expectAt(2, 'createFile', array(
|
$this->Task->expectAt(2, 'createFile', array(
|
||||||
TMP . 'view_task_comments' . DS . 'admin_add.ctp',
|
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(
|
$this->Task->expectAt(3, 'createFile', array(
|
||||||
TMP . 'view_task_comments' . DS . 'admin_edit.ctp',
|
TMP . 'view_task_comments' . DS . 'admin_edit.ctp',
|
||||||
new PatternExpectation('/Edit .+View Task Comment/')
|
new PatternExpectation('/Edit View Task Comment/')
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->Task->execute();
|
$this->Task->execute();
|
||||||
|
@ -634,4 +634,5 @@ class ViewTaskTest extends CakeTestCase {
|
||||||
$result = $this->Task->getTemplate('admin_add');
|
$result = $this->Task->getTemplate('admin_add');
|
||||||
$this->assertEqual($result, 'form');
|
$this->assertEqual($result, 'form');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases
|
* @subpackage cake.tests.cases
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5432
|
* @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
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.cache
|
* @subpackage cake.tests.cases.libs.cache
|
||||||
* @since CakePHP(tm) v 1.2.0.5434
|
* @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
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.cache
|
* @subpackage cake.tests.cases.libs.cache
|
||||||
* @since CakePHP(tm) v 1.2.0.5434
|
* @since CakePHP(tm) v 1.2.0.5434
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.cache
|
* @subpackage cake.tests.cases.libs.cache
|
||||||
* @since CakePHP(tm) v 1.2.0.5434
|
* @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
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.cache
|
* @subpackage cake.tests.cases.libs.cache
|
||||||
* @since CakePHP(tm) v 1.2.0.5434
|
* @since CakePHP(tm) v 1.2.0.5434
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5432
|
* @since CakePHP(tm) v 1.2.0.5432
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.cake.tests.libs
|
* @subpackage cake.cake.tests.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4667
|
* @since CakePHP(tm) v 1.2.0.4667
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5432
|
* @since CakePHP(tm) v 1.2.0.5432
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5432
|
* @since CakePHP(tm) v 1.2.0.5432
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.controller
|
* @subpackage cake.tests.cases.libs.controller
|
||||||
* @since CakePHP(tm) v 1.2.0.5436
|
* @since CakePHP(tm) v 1.2.0.5436
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.controller.components
|
* @subpackage cake.tests.cases.libs.controller.components
|
||||||
* @since CakePHP(tm) v 1.2.0.5435
|
* @since CakePHP(tm) v 1.2.0.5435
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.cake.tests.cases.libs.controller.components
|
* @subpackage cake.cake.tests.cases.libs.controller.components
|
||||||
* @since CakePHP(tm) v 1.2.0.5347
|
* @since CakePHP(tm) v 1.2.0.5347
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.controller.components
|
* @subpackage cake.tests.cases.libs.controller.components
|
||||||
* @since CakePHP(tm) v 1.2.0.5435
|
* @since CakePHP(tm) v 1.2.0.5435
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.cake.tests.cases.libs.controller.components
|
* @subpackage cake.cake.tests.cases.libs.controller.components
|
||||||
* @since CakePHP(tm) v 1.2.0.5347
|
* @since CakePHP(tm) v 1.2.0.5347
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.controller.components
|
* @subpackage cake.tests.cases.libs.controller.components
|
||||||
* @since CakePHP(tm) v 1.2.0.5435
|
* @since CakePHP(tm) v 1.2.0.5435
|
||||||
|
@ -21,6 +21,7 @@ App::import('Controller', 'Controller', false);
|
||||||
App::import('Component', array('RequestHandler'));
|
App::import('Component', array('RequestHandler'));
|
||||||
|
|
||||||
Mock::generatePartial('RequestHandlerComponent', 'NoStopRequestHandler', array('_stop'));
|
Mock::generatePartial('RequestHandlerComponent', 'NoStopRequestHandler', array('_stop'));
|
||||||
|
Mock::generatePartial('Controller', 'RequestHandlerMockController', array('header'));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RequestHandlerTestController class
|
* RequestHandlerTestController class
|
||||||
|
@ -601,9 +602,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testBeforeRedirectCallbackWithArrayUrl() {
|
function testBeforeRedirectCallbackWithArrayUrl() {
|
||||||
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
|
$_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(
|
Router::setRequestInfo(array(
|
||||||
array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'named' => array(), 'form' => array(), 'url' => array('url' => 'accounts/'), 'bare' => 0),
|
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/')
|
array('base' => '/officespace', 'here' => '/officespace/accounts/', 'webroot' => '/officespace/')
|
||||||
|
@ -618,7 +617,22 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$result = ob_get_clean();
|
$result = ob_get_clean();
|
||||||
$this->assertEqual($result, 'one: first two: second');
|
$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
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.controller.components
|
* @subpackage cake.tests.cases.libs.controller.components
|
||||||
* @since CakePHP(tm) v 1.2.0.5435
|
* @since CakePHP(tm) v 1.2.0.5435
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.controller.components
|
* @subpackage cake.tests.cases.libs.controller.components
|
||||||
* @since CakePHP(tm) v 1.2.0.5436
|
* @since CakePHP(tm) v 1.2.0.5436
|
||||||
|
@ -339,4 +339,41 @@ class SessionComponentTest extends CakeTestCase {
|
||||||
$Session->destroy('Test');
|
$Session->destroy('Test');
|
||||||
$this->assertNull($Session->read('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
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.controller
|
* @subpackage cake.tests.cases.libs.controller
|
||||||
* @since CakePHP(tm) v 1.2.3
|
* @since CakePHP(tm) v 1.2.3
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.controller
|
* @subpackage cake.tests.cases.libs.controller
|
||||||
* @since CakePHP(tm) v 1.2.0.5436
|
* @since CakePHP(tm) v 1.2.0.5436
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.controller
|
* @subpackage cake.tests.cases.libs.controller
|
||||||
* @since CakePHP(tm) v 1.2.0.5436
|
* @since CakePHP(tm) v 1.2.0.5436
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5432
|
* @since CakePHP(tm) v 1.2.0.5432
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5432
|
* @since CakePHP(tm) v 1.2.0.5432
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake.tests
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5432
|
* @since CakePHP(tm) v 1.2.0.5432
|
||||||
|
@ -426,6 +426,10 @@ class L10nTest extends CakeTestCase {
|
||||||
$result = $l10n->map(array('xho', 'xh'));
|
$result = $l10n->map(array('xho', 'xh'));
|
||||||
$expected = array('xho' => 'xh', 'xh' => 'xho');
|
$expected = array('xho' => 'xh', 'xh' => 'xho');
|
||||||
$this->assertEqual($result, $expected);
|
$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'));
|
$result = $l10n->map(array('yid', 'yi'));
|
||||||
$expected = array('yid' => 'yi', 'yi' => 'yid');
|
$expected = array('yid' => 'yi', 'yi' => 'yid');
|
||||||
|
@ -878,6 +882,13 @@ class L10nTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$this->assertEqual($result, $expected);
|
$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'));
|
$result = $l10n->catalog(array('xh'));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'xh' => array('language' => 'Xhosa', 'locale' => 'xho', 'localeFallback' => 'xho', 'charset' => 'utf-8', 'direction' => 'ltr')
|
'xh' => array('language' => 'Xhosa', 'locale' => 'xho', 'localeFallback' => 'xho', 'charset' => 'utf-8', 'direction' => 'ltr')
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.log
|
* @subpackage cake.tests.cases.libs.log
|
||||||
* @since CakePHP(tm) v 1.3
|
* @since CakePHP(tm) v 1.3
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.model.behaviors
|
* @subpackage cake.tests.cases.libs.model.behaviors
|
||||||
* @since CakePHP(tm) v 1.2.0.5669
|
* @since CakePHP(tm) v 1.2.0.5669
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.model.behaviors
|
* @subpackage cake.tests.cases.libs.model.behaviors
|
||||||
* @since CakePHP(tm) v 1.2.0.5669
|
* @since CakePHP(tm) v 1.2.0.5669
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.model.behaviors
|
* @subpackage cake.tests.cases.libs.model.behaviors
|
||||||
* @since CakePHP(tm) v 1.2.0.5330
|
* @since CakePHP(tm) v 1.2.0.5330
|
||||||
|
|
|
@ -5,14 +5,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5550
|
* @since CakePHP(tm) v 1.2.0.5550
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5550
|
* @since CakePHP(tm) v 1.2.0.5550
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.model.datasources
|
* @subpackage cake.tests.cases.libs.model.datasources
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.controller.components.dbacl.models
|
* @subpackage cake.tests.cases.libs.controller.components.dbacl.models
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.model
|
* @subpackage cake.tests.cases.libs.model
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -504,6 +504,28 @@ class BehaviorTest extends CakeTestCase {
|
||||||
$this->assertEqual($Apple->Behaviors->Test->settings['Apple'], $expected);
|
$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.
|
* test that attaching a non existant Behavior triggers a cake error.
|
||||||
*
|
*
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.model
|
* @subpackage cake.tests.cases.libs.model
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.model
|
* @subpackage cake.tests.cases.libs.model
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.model
|
* @subpackage cake.tests.cases.libs.model
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
@ -7291,6 +7291,21 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$this->assertTrue(isset($result['Author']['full_name']));
|
$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
|
* test that isVirtualField will accept both aliased and non aliased fieldnames
|
||||||
*
|
*
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.model
|
* @subpackage cake.tests.cases.libs.model
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.model
|
* @subpackage cake.tests.cases.libs.model
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
@ -897,6 +897,30 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$this->assertEqual($result, $expected);
|
$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
|
* testSaveWithSet method
|
||||||
*
|
*
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.model
|
* @subpackage cake.tests.cases.libs.model
|
||||||
* @since CakePHP(tm) v 1.2.0.6464
|
* @since CakePHP(tm) v 1.2.0.6464
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.6833
|
* @since CakePHP(tm) v 1.2.0.6833
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5432
|
* @since CakePHP(tm) v 1.2.0.5432
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5428
|
* @since CakePHP(tm) v 1.2.0.5428
|
||||||
|
@ -346,6 +346,32 @@ class SanitizeTest extends CakeTestCase {
|
||||||
$expected = '';
|
$expected = '';
|
||||||
$result = Sanitize::stripScripts($string);
|
$result = Sanitize::stripScripts($string);
|
||||||
$this->assertEqual($result, $expected);
|
$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
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5432
|
* @since CakePHP(tm) v 1.2.0.5432
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5432
|
* @since CakePHP(tm) v 1.2.0.5432
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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.
|
* Copyright 2005-2010, Cake Software Foundation, Inc.
|
||||||
* 1785 E. Sahara Avenue, Suite 490-204
|
* 1785 E. Sahara Avenue, Suite 490-204
|
||||||
* Las Vegas, Nevada 89104
|
* Las Vegas, Nevada 89104
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP Version 5.x
|
* PHP Version 5.x
|
||||||
*
|
*
|
||||||
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.view.helpers
|
* @subpackage cake.tests.cases.libs.view.helpers
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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.
|
* Copyright 2006-2010, Cake Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2006-2010, Cake Software Foundation, Inc.
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.view.helpers
|
* @subpackage cake.tests.cases.libs.view.helpers
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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.
|
* Copyright 2006-2010, Cake Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2006-2010, Cake Software Foundation, Inc.
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.view.helpers
|
* @subpackage cake.tests.cases.libs.view.helpers
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -209,6 +209,26 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
|
||||||
$this->assertEqual($result, $expected);
|
$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
|
* test sortable list generation
|
||||||
*
|
*
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.view.helpers
|
* @subpackage cake.tests.cases.libs.view.helpers
|
||||||
* @since CakePHP(tm) v 1.3
|
* @since CakePHP(tm) v 1.3
|
||||||
|
@ -309,7 +309,7 @@ class JsHelperTestCase extends CakeTestCase {
|
||||||
'request', array('/posts/view/1', $options)
|
'request', array('/posts/view/1', $options)
|
||||||
));
|
));
|
||||||
$this->Js->TestJsEngine->expectAt(2, 'dispatchMethod', array(
|
$this->Js->TestJsEngine->expectAt(2, 'dispatchMethod', array(
|
||||||
'event', array('click', 'ajax code', $options)
|
'event', array('click', 'ajax code', $options + array('buffer' => null))
|
||||||
));
|
));
|
||||||
|
|
||||||
$result = $this->Js->link('test link', '/posts/view/1', $options);
|
$result = $this->Js->link('test link', '/posts/view/1', $options);
|
||||||
|
@ -362,7 +362,9 @@ CODE;
|
||||||
*/
|
*/
|
||||||
function testLinkWithNoBuffering() {
|
function testLinkWithNoBuffering() {
|
||||||
$this->_useMock();
|
$this->_useMock();
|
||||||
$this->Js->TestJsEngine->setReturnValue('dispatchMethod', 'ajax code', array('request', '*'));
|
$this->Js->TestJsEngine->setReturnValue('dispatchMethod', 'ajax code', array(
|
||||||
|
'request', array('/posts/view/1', array('update' => '#content'))
|
||||||
|
));
|
||||||
$this->Js->TestJsEngine->setReturnValue('dispatchMethod', '-event handler-', array('event', '*'));
|
$this->Js->TestJsEngine->setReturnValue('dispatchMethod', '-event handler-', array('event', '*'));
|
||||||
|
|
||||||
$options = array('update' => '#content', 'buffer' => false);
|
$options = array('update' => '#content', 'buffer' => false);
|
||||||
|
@ -411,7 +413,7 @@ CODE;
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
'update' => $options['update'], 'data' => 'serialize-code',
|
'update' => $options['update'], 'data' => 'serialize-code',
|
||||||
'method' => 'post', 'dataExpression' => true
|
'method' => 'post', 'dataExpression' => true, 'buffer' => null
|
||||||
);
|
);
|
||||||
$this->Js->TestJsEngine->expectAt(3, 'dispatchMethod', array(
|
$this->Js->TestJsEngine->expectAt(3, 'dispatchMethod', array(
|
||||||
'event', array('click', "ajax-code", $params)
|
'event', array('click', "ajax-code", $params)
|
||||||
|
@ -440,7 +442,7 @@ CODE;
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
'update' => '#content', 'data' => 'serialize-code',
|
'update' => '#content', 'data' => 'serialize-code',
|
||||||
'method' => 'post', 'dataExpression' => true
|
'method' => 'post', 'dataExpression' => true, 'buffer' => null
|
||||||
);
|
);
|
||||||
$this->Js->TestJsEngine->expectAt(7, 'dispatchMethod', array(
|
$this->Js->TestJsEngine->expectAt(7, 'dispatchMethod', array(
|
||||||
'event', array('click', "ajax-code", $params)
|
'event', array('click', "ajax-code", $params)
|
||||||
|
@ -471,11 +473,13 @@ CODE;
|
||||||
|
|
||||||
$this->Js->TestJsEngine->expectAt(0, 'dispatchMethod', array('get', '*'));
|
$this->Js->TestJsEngine->expectAt(0, 'dispatchMethod', array('get', '*'));
|
||||||
$this->Js->TestJsEngine->expectAt(1, 'dispatchMethod', array(new PatternExpectation('/serializeForm/i'), '*'));
|
$this->Js->TestJsEngine->expectAt(1, 'dispatchMethod', array(new PatternExpectation('/serializeForm/i'), '*'));
|
||||||
$this->Js->TestJsEngine->expectAt(2, 'dispatchMethod', array('request', '*'));
|
$this->Js->TestJsEngine->expectAt(2, 'dispatchMethod', array('request', array(
|
||||||
|
'', array('update' => $options['update'], 'data' => 'serialize-code', 'method' => 'post', 'dataExpression' => true)
|
||||||
|
)));
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
'update' => $options['update'], 'buffer' => false, 'safe' => false, 'data' => 'serialize-code',
|
'update' => $options['update'], 'data' => 'serialize-code',
|
||||||
'method' => 'post', 'dataExpression' => true
|
'method' => 'post', 'dataExpression' => true, 'buffer' => false
|
||||||
);
|
);
|
||||||
$this->Js->TestJsEngine->expectAt(3, 'dispatchMethod', array(
|
$this->Js->TestJsEngine->expectAt(3, 'dispatchMethod', array(
|
||||||
'event', array('click', "ajax-code", $params)
|
'event', array('click', "ajax-code", $params)
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.view.helpers
|
* @subpackage cake.tests.cases.libs.view.helpers
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.view.helpers
|
* @subpackage cake.tests.cases.libs.view.helpers
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
@ -181,7 +181,6 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
$result = $this->Paginator->sort('title');
|
$result = $this->Paginator->sort('title');
|
||||||
$this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:asc" class="desc">Title<\/a>$/', $result);
|
$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']['order'] = array('Article.title' => 'asc');
|
||||||
$this->Paginator->params['paging']['Article']['options']['sort'] = null;
|
$this->Paginator->params['paging']['Article']['options']['sort'] = null;
|
||||||
$result = $this->Paginator->sort('title');
|
$result = $this->Paginator->sort('title');
|
||||||
|
@ -192,23 +191,71 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
$result = $this->Paginator->sort('Title', 'title', array('direction' => 'desc'));
|
$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->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']['order'] = array('Article.title' => 'desc');
|
||||||
$this->Paginator->params['paging']['Article']['options']['sort'] = null;
|
$this->Paginator->params['paging']['Article']['options']['sort'] = null;
|
||||||
$result = $this->Paginator->sort('Title', 'title', array('direction' => 'asc'));
|
$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->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']['order'] = array('Article.title' => 'asc');
|
||||||
$this->Paginator->params['paging']['Article']['options']['sort'] = null;
|
$this->Paginator->params['paging']['Article']['options']['sort'] = null;
|
||||||
$result = $this->Paginator->sort('Title', 'title', array('direction' => 'asc'));
|
$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->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']['order'] = array('Article.title' => 'asc');
|
||||||
$this->Paginator->params['paging']['Article']['options']['sort'] = null;
|
$this->Paginator->params['paging']['Article']['options']['sort'] = null;
|
||||||
$result = $this->Paginator->sort('Title', 'title', array('direction' => 'desc'));
|
$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->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
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.view.helpers
|
* @subpackage cake.tests.cases.libs.view.helpers
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.view.helpers
|
* @subpackage cake.tests.cases.libs.view.helpers
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.view.helpers
|
* @subpackage cake.tests.cases.libs.view.helpers
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.view.helpers
|
* @subpackage cake.tests.cases.libs.view.helpers
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.view.helpers
|
* @subpackage cake.tests.cases.libs.view.helpers
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* 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)
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @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
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs
|
* @subpackage cake.tests.cases.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4206
|
* @since CakePHP(tm) v 1.2.0.4206
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue