mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Merge pull request #345 from shama/patch-standards
Adhere to code formatting standard
This commit is contained in:
commit
95e8f1d8b2
84 changed files with 474 additions and 474 deletions
|
@ -505,7 +505,7 @@ abstract class CacheEngine {
|
||||||
*/
|
*/
|
||||||
public function init($settings = array()) {
|
public function init($settings = array()) {
|
||||||
$this->settings = array_merge(
|
$this->settings = array_merge(
|
||||||
array('prefix' => 'cake_', 'duration'=> 3600, 'probability'=> 100),
|
array('prefix' => 'cake_', 'duration' => 3600, 'probability' => 100),
|
||||||
$this->settings,
|
$this->settings,
|
||||||
$settings
|
$settings
|
||||||
);
|
);
|
||||||
|
|
|
@ -66,8 +66,8 @@ class FileEngine extends CacheEngine {
|
||||||
public function init($settings = array()) {
|
public function init($settings = array()) {
|
||||||
parent::init(array_merge(
|
parent::init(array_merge(
|
||||||
array(
|
array(
|
||||||
'engine' => 'File', 'path' => CACHE, 'prefix'=> 'cake_', 'lock'=> true,
|
'engine' => 'File', 'path' => CACHE, 'prefix' => 'cake_', 'lock' => true,
|
||||||
'serialize'=> true, 'isWindows' => false, 'mask' => 0664
|
'serialize' => true, 'isWindows' => false, 'mask' => 0664
|
||||||
),
|
),
|
||||||
$settings
|
$settings
|
||||||
));
|
));
|
||||||
|
|
|
@ -59,10 +59,10 @@ class MemcacheEngine extends CacheEngine {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
parent::init(array_merge(array(
|
parent::init(array_merge(array(
|
||||||
'engine'=> 'Memcache',
|
'engine' => 'Memcache',
|
||||||
'prefix' => Inflector::slug(APP_DIR) . '_',
|
'prefix' => Inflector::slug(APP_DIR) . '_',
|
||||||
'servers' => array('127.0.0.1'),
|
'servers' => array('127.0.0.1'),
|
||||||
'compress'=> false,
|
'compress' => false,
|
||||||
'persistent' => true
|
'persistent' => true
|
||||||
), $settings)
|
), $settings)
|
||||||
);
|
);
|
||||||
|
|
|
@ -117,7 +117,7 @@ class ConsoleShell extends AppShell {
|
||||||
$out .= "\n";
|
$out .= "\n";
|
||||||
$out .= "will return something like the following:";
|
$out .= "will return something like the following:";
|
||||||
$out .= "\n";
|
$out .= "\n";
|
||||||
$out .= "\tarray (";
|
$out .= "\tarray(";
|
||||||
$out .= "\t [...]";
|
$out .= "\t [...]";
|
||||||
$out .= "\t 'controller' => 'posts',";
|
$out .= "\t 'controller' => 'posts',";
|
||||||
$out .= "\t 'action' => 'view',";
|
$out .= "\t 'action' => 'view',";
|
||||||
|
|
|
@ -39,14 +39,14 @@ class DbConfigTask extends AppShell {
|
||||||
*/
|
*/
|
||||||
protected $_defaultConfig = array(
|
protected $_defaultConfig = array(
|
||||||
'name' => 'default',
|
'name' => 'default',
|
||||||
'datasource'=> 'Database/Mysql',
|
'datasource' => 'Database/Mysql',
|
||||||
'persistent'=> 'false',
|
'persistent' => 'false',
|
||||||
'host'=> 'localhost',
|
'host' => 'localhost',
|
||||||
'login'=> 'root',
|
'login' => 'root',
|
||||||
'password'=> 'password',
|
'password' => 'password',
|
||||||
'database'=> 'project_name',
|
'database' => 'project_name',
|
||||||
'schema'=> null,
|
'schema' => null,
|
||||||
'prefix'=> null,
|
'prefix' => null,
|
||||||
'encoding' => null,
|
'encoding' => null,
|
||||||
'port' => null
|
'port' => null
|
||||||
);
|
);
|
||||||
|
|
|
@ -220,13 +220,13 @@ class ModelTask extends BakeTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
$prompt = __d('cake_console', "Would you like to supply validation criteria \nfor the fields in your model?");
|
$prompt = __d('cake_console', "Would you like to supply validation criteria \nfor the fields in your model?");
|
||||||
$wannaDoValidation = $this->in($prompt, array('y','n'), 'y');
|
$wannaDoValidation = $this->in($prompt, array('y', 'n'), 'y');
|
||||||
if (array_search($useTable, $this->_tables) !== false && strtolower($wannaDoValidation) == 'y') {
|
if (array_search($useTable, $this->_tables) !== false && strtolower($wannaDoValidation) == 'y') {
|
||||||
$validate = $this->doValidation($tempModel);
|
$validate = $this->doValidation($tempModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
$prompt = __d('cake_console', "Would you like to define model associations\n(hasMany, hasOne, belongsTo, etc.)?");
|
$prompt = __d('cake_console', "Would you like to define model associations\n(hasMany, hasOne, belongsTo, etc.)?");
|
||||||
$wannaDoAssoc = $this->in($prompt, array('y','n'), 'y');
|
$wannaDoAssoc = $this->in($prompt, array('y', 'n'), 'y');
|
||||||
if (strtolower($wannaDoAssoc) == 'y') {
|
if (strtolower($wannaDoAssoc) == 'y') {
|
||||||
$associations = $this->doAssociations($tempModel);
|
$associations = $this->doAssociations($tempModel);
|
||||||
}
|
}
|
||||||
|
@ -258,7 +258,7 @@ class ModelTask extends BakeTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y','n'), 'y');
|
$looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y', 'n'), 'y');
|
||||||
|
|
||||||
if (strtolower($looksGood) == 'y') {
|
if (strtolower($looksGood) == 'y') {
|
||||||
$vars = compact('associations', 'validate', 'primaryKey', 'useTable', 'displayField');
|
$vars = compact('associations', 'validate', 'primaryKey', 'useTable', 'displayField');
|
||||||
|
@ -486,7 +486,7 @@ class ModelTask extends BakeTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
$associations = array(
|
$associations = array(
|
||||||
'belongsTo' => array(), 'hasMany' => array(), 'hasOne'=> array(), 'hasAndBelongsToMany' => array()
|
'belongsTo' => array(), 'hasMany' => array(), 'hasOne' => array(), 'hasAndBelongsToMany' => array()
|
||||||
);
|
);
|
||||||
|
|
||||||
$associations = $this->findBelongsTo($model, $associations);
|
$associations = $this->findBelongsTo($model, $associations);
|
||||||
|
@ -635,7 +635,7 @@ class ModelTask extends BakeTask {
|
||||||
if (!empty($associations[$type])) {
|
if (!empty($associations[$type])) {
|
||||||
foreach ($associations[$type] as $i => $assoc) {
|
foreach ($associations[$type] as $i => $assoc) {
|
||||||
$prompt = "{$model->name} {$type} {$assoc['alias']}?";
|
$prompt = "{$model->name} {$type} {$assoc['alias']}?";
|
||||||
$response = $this->in($prompt, array('y','n'), 'y');
|
$response = $this->in($prompt, array('y', 'n'), 'y');
|
||||||
|
|
||||||
if ('n' == strtolower($response)) {
|
if ('n' == strtolower($response)) {
|
||||||
unset($associations[$type][$i]);
|
unset($associations[$type][$i]);
|
||||||
|
@ -658,7 +658,7 @@ class ModelTask extends BakeTask {
|
||||||
*/
|
*/
|
||||||
public function doMoreAssociations($model, $associations) {
|
public function doMoreAssociations($model, $associations) {
|
||||||
$prompt = __d('cake_console', 'Would you like to define some additional model associations?');
|
$prompt = __d('cake_console', 'Would you like to define some additional model associations?');
|
||||||
$wannaDoMoreAssoc = $this->in($prompt, array('y','n'), 'n');
|
$wannaDoMoreAssoc = $this->in($prompt, array('y', 'n'), 'n');
|
||||||
$possibleKeys = $this->_generatePossibleKeys();
|
$possibleKeys = $this->_generatePossibleKeys();
|
||||||
while (strtolower($wannaDoMoreAssoc) == 'y') {
|
while (strtolower($wannaDoMoreAssoc) == 'y') {
|
||||||
$assocs = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
|
$assocs = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
|
||||||
|
@ -710,7 +710,7 @@ class ModelTask extends BakeTask {
|
||||||
$associations[$assocs[$assocType]][$i]['associationForeignKey'] = $associationForeignKey;
|
$associations[$assocs[$assocType]][$i]['associationForeignKey'] = $associationForeignKey;
|
||||||
$associations[$assocs[$assocType]][$i]['joinTable'] = $joinTable;
|
$associations[$assocs[$assocType]][$i]['joinTable'] = $joinTable;
|
||||||
}
|
}
|
||||||
$wannaDoMoreAssoc = $this->in(__d('cake_console', 'Define another association?'), array('y','n'), 'y');
|
$wannaDoMoreAssoc = $this->in(__d('cake_console', 'Define another association?'), array('y', 'n'), 'y');
|
||||||
}
|
}
|
||||||
return $associations;
|
return $associations;
|
||||||
}
|
}
|
||||||
|
@ -832,7 +832,7 @@ class ModelTask extends BakeTask {
|
||||||
if (array_search($useTable, $this->_tables) === false) {
|
if (array_search($useTable, $this->_tables) === false) {
|
||||||
$this->out();
|
$this->out();
|
||||||
$this->out(__d('cake_console', "Given your model named '%s',\nCake would expect a database table named '%s'", $modelName, $fullTableName));
|
$this->out(__d('cake_console', "Given your model named '%s',\nCake would expect a database table named '%s'", $modelName, $fullTableName));
|
||||||
$tableIsGood = $this->in(__d('cake_console', 'Do you want to use this table?'), array('y','n'), 'y');
|
$tableIsGood = $this->in(__d('cake_console', 'Do you want to use this table?'), array('y', 'n'), 'y');
|
||||||
}
|
}
|
||||||
if (strtolower($tableIsGood) == 'n') {
|
if (strtolower($tableIsGood) == 'n') {
|
||||||
$useTable = $this->in(__d('cake_console', 'What is the name of the table?'));
|
$useTable = $this->in(__d('cake_console', 'What is the name of the table?'));
|
||||||
|
|
|
@ -62,7 +62,7 @@ class ProjectTask extends AppShell {
|
||||||
$response = false;
|
$response = false;
|
||||||
while ($response == false && is_dir($project) === true && file_exists($project . 'Config' . 'core.php')) {
|
while ($response == false && is_dir($project) === true && file_exists($project . 'Config' . 'core.php')) {
|
||||||
$prompt = __d('cake_console', '<warning>A project already exists in this location:</warning> %s Overwrite?', $project);
|
$prompt = __d('cake_console', '<warning>A project already exists in this location:</warning> %s Overwrite?', $project);
|
||||||
$response = $this->in($prompt, array('y','n'), 'n');
|
$response = $this->in($prompt, array('y', 'n'), 'n');
|
||||||
if (strtolower($response) === 'n') {
|
if (strtolower($response) === 'n') {
|
||||||
$response = $project = false;
|
$response = $project = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -402,7 +402,7 @@ class TestTask extends BakeTask {
|
||||||
* @return array Array of fixtures the user wants to add.
|
* @return array Array of fixtures the user wants to add.
|
||||||
*/
|
*/
|
||||||
public function getUserFixtures() {
|
public function getUserFixtures() {
|
||||||
$proceed = $this->in(__d('cake_console', 'Bake could not detect fixtures, would you like to add some?'), array('y','n'), 'n');
|
$proceed = $this->in(__d('cake_console', 'Bake could not detect fixtures, would you like to add some?'), array('y', 'n'), 'n');
|
||||||
$fixtures = array();
|
$fixtures = array();
|
||||||
if (strtolower($proceed) == 'y') {
|
if (strtolower($proceed) == 'y') {
|
||||||
$fixtureList = $this->in(__d('cake_console', "Please provide a comma separated list of the fixtures names you'd like to use.\nExample: 'app.comment, app.post, plugin.forums.post'"));
|
$fixtureList = $this->in(__d('cake_console', "Please provide a comma separated list of the fixtures names you'd like to use.\nExample: 'app.comment, app.post, plugin.forums.post'"));
|
||||||
|
|
|
@ -215,9 +215,9 @@ class ViewTask extends BakeTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
$prompt = __d('cake_console', "Would you like to create some CRUD views\n(index, add, view, edit) for this controller?\nNOTE: Before doing so, you'll need to create your controller\nand model classes (including associated models).");
|
$prompt = __d('cake_console', "Would you like to create some CRUD views\n(index, add, view, edit) for this controller?\nNOTE: Before doing so, you'll need to create your controller\nand model classes (including associated models).");
|
||||||
$wannaDoScaffold = $this->in($prompt, array('y','n'), 'y');
|
$wannaDoScaffold = $this->in($prompt, array('y', 'n'), 'y');
|
||||||
|
|
||||||
$wannaDoAdmin = $this->in(__d('cake_console', "Would you like to create the views for admin routing?"), array('y','n'), 'n');
|
$wannaDoAdmin = $this->in(__d('cake_console', "Would you like to create the views for admin routing?"), array('y', 'n'), 'n');
|
||||||
|
|
||||||
if (strtolower($wannaDoScaffold) == 'y' || strtolower($wannaDoAdmin) == 'y') {
|
if (strtolower($wannaDoScaffold) == 'y' || strtolower($wannaDoAdmin) == 'y') {
|
||||||
$vars = $this->_loadController();
|
$vars = $this->_loadController();
|
||||||
|
@ -292,7 +292,7 @@ class ViewTask extends BakeTask {
|
||||||
$pluralHumanName = $this->_pluralHumanName($this->controllerName);
|
$pluralHumanName = $this->_pluralHumanName($this->controllerName);
|
||||||
|
|
||||||
return compact('modelClass', 'schema', 'primaryKey', 'displayField', 'singularVar', 'pluralVar',
|
return compact('modelClass', 'schema', 'primaryKey', 'displayField', 'singularVar', 'pluralVar',
|
||||||
'singularHumanName', 'pluralHumanName', 'fields','associations');
|
'singularHumanName', 'pluralHumanName', 'fields', 'associations');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -330,7 +330,7 @@ class ViewTask extends BakeTask {
|
||||||
$this->out(__d('cake_console', 'Action Name: %s', $action));
|
$this->out(__d('cake_console', 'Action Name: %s', $action));
|
||||||
$this->out(__d('cake_console', 'Path: %s', $this->getPath() . $this->controllerName . DS . Inflector::underscore($action) . ".ctp"));
|
$this->out(__d('cake_console', 'Path: %s', $this->getPath() . $this->controllerName . DS . Inflector::underscore($action) . ".ctp"));
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y','n'), 'y');
|
$looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y', 'n'), 'y');
|
||||||
if (strtolower($looksGood) == 'y') {
|
if (strtolower($looksGood) == 'y') {
|
||||||
$this->bake($action, ' ');
|
$this->bake($action, ' ');
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
|
|
|
@ -764,7 +764,7 @@ class UpgradeShell extends AppShell {
|
||||||
'help' => __d('cake_console', 'Use git command for moving files around.'),
|
'help' => __d('cake_console', 'Use git command for moving files around.'),
|
||||||
'boolean' => true
|
'boolean' => true
|
||||||
),
|
),
|
||||||
'dry-run'=> array(
|
'dry-run' => array(
|
||||||
'short' => 'd',
|
'short' => 'd',
|
||||||
'help' => __d('cake_console', 'Dry run the update, no files will actually be modified.'),
|
'help' => __d('cake_console', 'Dry run the update, no files will actually be modified.'),
|
||||||
'boolean' => true
|
'boolean' => true
|
||||||
|
|
|
@ -366,7 +366,7 @@ class Shell extends Object {
|
||||||
return $this->_displayHelp($command);
|
return $this->_displayHelp($command);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($isTask || $isMethod || $isMain) && $command !== 'execute' ) {
|
if (($isTask || $isMethod || $isMain) && $command !== 'execute') {
|
||||||
$this->startup();
|
$this->startup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -672,7 +672,7 @@ class Shell extends Object {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$prompt = __d('cake_console', 'PHPUnit is not installed. Do you want to bake unit test files anyway?');
|
$prompt = __d('cake_console', 'PHPUnit is not installed. Do you want to bake unit test files anyway?');
|
||||||
$unitTest = $this->in($prompt, array('y','n'), 'y');
|
$unitTest = $this->in($prompt, array('y', 'n'), 'y');
|
||||||
$result = strtolower($unitTest) == 'y' || strtolower($unitTest) == 'yes';
|
$result = strtolower($unitTest) == 'y' || strtolower($unitTest) == 'yes';
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|
|
@ -143,7 +143,7 @@
|
||||||
if ($this-><?php echo $currentModelName; ?>->delete()) {
|
if ($this-><?php echo $currentModelName; ?>->delete()) {
|
||||||
<?php if ($wannaUseSession): ?>
|
<?php if ($wannaUseSession): ?>
|
||||||
$this->Session->setFlash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'));
|
$this->Session->setFlash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'));
|
||||||
$this->redirect(array('action'=>'index'));
|
$this->redirect(array('action' => 'index'));
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
$this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'), array('action' => 'index'));
|
$this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'), array('action' => 'index'));
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
|
@ -39,35 +39,35 @@ class DbAclSchema extends CakeSchema {
|
||||||
}
|
}
|
||||||
|
|
||||||
public $acos = array(
|
public $acos = array(
|
||||||
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
|
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
|
||||||
'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
||||||
'model' => array('type'=>'string', 'null' => true),
|
'model' => array('type' => 'string', 'null' => true),
|
||||||
'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
||||||
'alias' => array('type'=>'string', 'null' => true),
|
'alias' => array('type' => 'string', 'null' => true),
|
||||||
'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
'lft' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
||||||
'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
'rght' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
||||||
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
|
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
|
||||||
);
|
);
|
||||||
|
|
||||||
public $aros = array(
|
public $aros = array(
|
||||||
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
|
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
|
||||||
'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
||||||
'model' => array('type'=>'string', 'null' => true),
|
'model' => array('type' => 'string', 'null' => true),
|
||||||
'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
||||||
'alias' => array('type'=>'string', 'null' => true),
|
'alias' => array('type' => 'string', 'null' => true),
|
||||||
'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
'lft' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
||||||
'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
'rght' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
||||||
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
|
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
|
||||||
);
|
);
|
||||||
|
|
||||||
public $aros_acos = array(
|
public $aros_acos = array(
|
||||||
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
|
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
|
||||||
'aro_id' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
|
'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
|
||||||
'aco_id' => array('type'=>'integer', 'null' => false, 'length' => 10),
|
'aco_id' => array('type' => 'integer', 'null' => false, 'length' => 10),
|
||||||
'_create' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
|
'_create' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
|
||||||
'_read' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
|
'_read' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
|
||||||
'_update' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
|
'_update' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
|
||||||
'_delete' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
|
'_delete' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
|
||||||
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1))
|
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -39,12 +39,12 @@ class i18nSchema extends CakeSchema {
|
||||||
}
|
}
|
||||||
|
|
||||||
public $i18n = array(
|
public $i18n = array(
|
||||||
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
|
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
|
||||||
'locale' => array('type'=>'string', 'null' => false, 'length' => 6, 'key' => 'index'),
|
'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
|
||||||
'model' => array('type'=>'string', 'null' => false, 'key' => 'index'),
|
'model' => array('type' => 'string', 'null' => false, 'key' => 'index'),
|
||||||
'foreign_key' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
|
'foreign_key' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
|
||||||
'field' => array('type'=>'string', 'null' => false, 'key' => 'index'),
|
'field' => array('type' => 'string', 'null' => false, 'key' => 'index'),
|
||||||
'content' => array('type'=>'text', 'null' => true, 'default' => NULL),
|
'content' => array('type' => 'text', 'null' => true, 'default' => NULL),
|
||||||
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0))
|
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -39,9 +39,9 @@ class SessionsSchema extends CakeSchema {
|
||||||
}
|
}
|
||||||
|
|
||||||
public $cake_sessions = array(
|
public $cake_sessions = array(
|
||||||
'id' => array('type'=>'string', 'null' => false, 'key' => 'primary'),
|
'id' => array('type' => 'string', 'null' => false, 'key' => 'primary'),
|
||||||
'data' => array('type'=>'text', 'null' => true, 'default' => NULL),
|
'data' => array('type' => 'text', 'null' => true, 'default' => NULL),
|
||||||
'expires' => array('type'=>'integer', 'null' => true, 'default' => NULL),
|
'expires' => array('type' => 'integer', 'null' => true, 'default' => NULL),
|
||||||
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
|
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -239,8 +239,8 @@
|
||||||
*
|
*
|
||||||
* Cache::config('default', array(
|
* Cache::config('default', array(
|
||||||
* 'engine' => 'File', //[required]
|
* 'engine' => 'File', //[required]
|
||||||
* 'duration'=> 3600, //[optional]
|
* 'duration' => 3600, //[optional]
|
||||||
* 'probability'=> 100, //[optional]
|
* 'probability' => 100, //[optional]
|
||||||
* 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
|
* 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
|
||||||
* 'prefix' => 'cake_', //[optional] prefix every cache file with this string
|
* 'prefix' => 'cake_', //[optional] prefix every cache file with this string
|
||||||
* 'lock' => false, //[optional] use file locking
|
* 'lock' => false, //[optional] use file locking
|
||||||
|
@ -251,8 +251,8 @@
|
||||||
*
|
*
|
||||||
* Cache::config('default', array(
|
* Cache::config('default', array(
|
||||||
* 'engine' => 'Apc', //[required]
|
* 'engine' => 'Apc', //[required]
|
||||||
* 'duration'=> 3600, //[optional]
|
* 'duration' => 3600, //[optional]
|
||||||
* 'probability'=> 100, //[optional]
|
* 'probability' => 100, //[optional]
|
||||||
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
|
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
|
||||||
* ));
|
* ));
|
||||||
*
|
*
|
||||||
|
@ -260,8 +260,8 @@
|
||||||
*
|
*
|
||||||
* Cache::config('default', array(
|
* Cache::config('default', array(
|
||||||
* 'engine' => 'Xcache', //[required]
|
* 'engine' => 'Xcache', //[required]
|
||||||
* 'duration'=> 3600, //[optional]
|
* 'duration' => 3600, //[optional]
|
||||||
* 'probability'=> 100, //[optional]
|
* 'probability' => 100, //[optional]
|
||||||
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
|
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
|
||||||
* 'user' => 'user', //user from xcache.admin.user settings
|
* 'user' => 'user', //user from xcache.admin.user settings
|
||||||
* 'password' => 'password', //plaintext password (xcache.admin.pass)
|
* 'password' => 'password', //plaintext password (xcache.admin.pass)
|
||||||
|
@ -271,8 +271,8 @@
|
||||||
*
|
*
|
||||||
* Cache::config('default', array(
|
* Cache::config('default', array(
|
||||||
* 'engine' => 'Memcache', //[required]
|
* 'engine' => 'Memcache', //[required]
|
||||||
* 'duration'=> 3600, //[optional]
|
* 'duration' => 3600, //[optional]
|
||||||
* 'probability'=> 100, //[optional]
|
* 'probability' => 100, //[optional]
|
||||||
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
|
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
|
||||||
* 'servers' => array(
|
* 'servers' => array(
|
||||||
* '127.0.0.1:11211' // localhost, default port 11211
|
* '127.0.0.1:11211' // localhost, default port 11211
|
||||||
|
@ -285,8 +285,8 @@
|
||||||
*
|
*
|
||||||
* Cache::config('default', array(
|
* Cache::config('default', array(
|
||||||
* 'engine' => 'Wincache', //[required]
|
* 'engine' => 'Wincache', //[required]
|
||||||
* 'duration'=> 3600, //[optional]
|
* 'duration' => 3600, //[optional]
|
||||||
* 'probability'=> 100, //[optional]
|
* 'probability' => 100, //[optional]
|
||||||
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
|
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
|
||||||
* ));
|
* ));
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<?php echo $this->Html->link(
|
<?php echo $this->Html->link(
|
||||||
$this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework'), 'border' => '0')),
|
$this->Html->image('cake.power.gif', array('alt' => __('CakePHP: the rapid development php framework'), 'border' => '0')),
|
||||||
'http://www.cakephp.org/',
|
'http://www.cakephp.org/',
|
||||||
array('target' => '_blank', 'escape' => false)
|
array('target' => '_blank', 'escape' => false)
|
||||||
);
|
);
|
||||||
|
|
|
@ -16,16 +16,16 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
* {
|
* {
|
||||||
margin:0;
|
margin: 0;
|
||||||
padding:0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** General Style Info **/
|
/** General Style Info **/
|
||||||
body {
|
body {
|
||||||
background: #003d4c;
|
background: #003d4c;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-family:'lucida grande',verdana,helvetica,arial,sans-serif;
|
font-family: 'lucida grande', verdana, helvetica, arial, sans-serif;
|
||||||
font-size:90%;
|
font-size: 90%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
|
@ -35,29 +35,29 @@ a {
|
||||||
}
|
}
|
||||||
a:hover {
|
a:hover {
|
||||||
color: #367889;
|
color: #367889;
|
||||||
text-decoration:none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
a img {
|
a img {
|
||||||
border:none;
|
border: none;
|
||||||
}
|
}
|
||||||
h1, h2, h3, h4 {
|
h1, h2, h3, h4 {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
margin-bottom:0.5em;
|
margin-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
h1 {
|
h1 {
|
||||||
background:#fff;
|
background: #fff;
|
||||||
color: #003d4c;
|
color: #003d4c;
|
||||||
font-size: 100%;
|
font-size: 100%;
|
||||||
}
|
}
|
||||||
h2 {
|
h2 {
|
||||||
background:#fff;
|
background: #fff;
|
||||||
color: #e32;
|
color: #e32;
|
||||||
font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif;
|
font-family: 'Gill Sans', 'lucida grande', helvetica, arial, sans-serif;
|
||||||
font-size: 190%;
|
font-size: 190%;
|
||||||
}
|
}
|
||||||
h3 {
|
h3 {
|
||||||
color: #2c6877;
|
color: #2c6877;
|
||||||
font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif;
|
font-family: 'Gill Sans', 'lucida grande', helvetica, arial, sans-serif;
|
||||||
font-size: 165%;
|
font-size: 165%;
|
||||||
}
|
}
|
||||||
h4 {
|
h4 {
|
||||||
|
@ -80,7 +80,7 @@ p {
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
}
|
}
|
||||||
#header h1 {
|
#header h1 {
|
||||||
line-height:20px;
|
line-height: 20px;
|
||||||
background: #003d4c url('../img/cake.icon.png') no-repeat left;
|
background: #003d4c url('../img/cake.icon.png') no-repeat left;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding: 0px 30px;
|
padding: 0px 30px;
|
||||||
|
@ -113,35 +113,35 @@ p {
|
||||||
div.form,
|
div.form,
|
||||||
div.index,
|
div.index,
|
||||||
div.view {
|
div.view {
|
||||||
float:right;
|
float: right;
|
||||||
width:76%;
|
width: 76%;
|
||||||
border-left:1px solid #666;
|
border-left: 1px solid #666;
|
||||||
padding:10px 2%;
|
padding: 10px 2%;
|
||||||
}
|
}
|
||||||
div.actions {
|
div.actions {
|
||||||
float:left;
|
float: left;
|
||||||
width:16%;
|
width: 16%;
|
||||||
padding:10px 1.5%;
|
padding: 10px 1.5%;
|
||||||
}
|
}
|
||||||
div.actions h3 {
|
div.actions h3 {
|
||||||
padding-top:0;
|
padding-top: 0;
|
||||||
color:#777;
|
color: #777;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Tables **/
|
/** Tables **/
|
||||||
table {
|
table {
|
||||||
border-right:0;
|
border-right: 0;
|
||||||
clear: both;
|
clear: both;
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
th {
|
th {
|
||||||
border:0;
|
border: 0;
|
||||||
border-bottom:2px solid #555;
|
border-bottom: 2px solid #555;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding:4px;
|
padding: 4px;
|
||||||
}
|
}
|
||||||
th a {
|
th a {
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -158,7 +158,7 @@ table tr td {
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
border-bottom:1px solid #ddd;
|
border-bottom: 1px solid #ddd;
|
||||||
}
|
}
|
||||||
table tr:nth-child(even) {
|
table tr:nth-child(even) {
|
||||||
background: #f9f9f9;
|
background: #f9f9f9;
|
||||||
|
@ -169,7 +169,7 @@ td.actions {
|
||||||
}
|
}
|
||||||
table td.actions a {
|
table td.actions a {
|
||||||
margin: 0px 6px;
|
margin: 0px 6px;
|
||||||
padding:2px 5px;
|
padding: 2px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SQL log */
|
/* SQL log */
|
||||||
|
@ -182,15 +182,15 @@ table td.actions a {
|
||||||
font-family: Monaco, Consolas, "Courier New", monospaced;
|
font-family: Monaco, Consolas, "Courier New", monospaced;
|
||||||
}
|
}
|
||||||
.cake-sql-log caption {
|
.cake-sql-log caption {
|
||||||
color:#fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Paging **/
|
/** Paging **/
|
||||||
.paging {
|
.paging {
|
||||||
background:#fff;
|
background: #fff;
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
clear:both;
|
clear: both;
|
||||||
}
|
}
|
||||||
.paging .current,
|
.paging .current,
|
||||||
.paging .disabled,
|
.paging .disabled,
|
||||||
|
@ -296,7 +296,7 @@ form .required {
|
||||||
form .required label:after {
|
form .required label:after {
|
||||||
color: #e32;
|
color: #e32;
|
||||||
content: '*';
|
content: '*';
|
||||||
display:inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
form div.submit {
|
form div.submit {
|
||||||
border: 0;
|
border: 0;
|
||||||
|
@ -306,14 +306,14 @@ form div.submit {
|
||||||
label {
|
label {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 110%;
|
font-size: 110%;
|
||||||
margin-bottom:3px;
|
margin-bottom: 3px;
|
||||||
}
|
}
|
||||||
input, textarea {
|
input, textarea {
|
||||||
clear: both;
|
clear: both;
|
||||||
font-size: 140%;
|
font-size: 140%;
|
||||||
font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif;
|
font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif;
|
||||||
padding: 1%;
|
padding: 1%;
|
||||||
width:98%;
|
width: 98%;
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
clear: both;
|
clear: both;
|
||||||
|
@ -337,8 +337,8 @@ div.checkbox label {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
input[type=radio] {
|
input[type=radio] {
|
||||||
float:left;
|
float: left;
|
||||||
width:auto;
|
width: auto;
|
||||||
margin: 6px 0;
|
margin: 6px 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
line-height: 26px;
|
line-height: 26px;
|
||||||
|
@ -353,7 +353,7 @@ input[type=submit] {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
form .submit input[type=submit] {
|
form .submit input[type=submit] {
|
||||||
background:#62af56;
|
background: #62af56;
|
||||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#76BF6B), to(#3B8230));
|
background-image: -webkit-gradient(linear, left top, left bottom, from(#76BF6B), to(#3B8230));
|
||||||
background-image: -webkit-linear-gradient(top, #76BF6B, #3B8230);
|
background-image: -webkit-linear-gradient(top, #76BF6B, #3B8230);
|
||||||
background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
|
background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
|
||||||
|
@ -491,7 +491,7 @@ p.error em {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
.actions li {
|
.actions li {
|
||||||
margin:0 0 0.5em 0;
|
margin: 0 0 0.5em 0;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -506,7 +506,7 @@ p.error em {
|
||||||
input[type=submit],
|
input[type=submit],
|
||||||
.actions ul li a,
|
.actions ul li a,
|
||||||
.actions a {
|
.actions a {
|
||||||
font-weight:normal;
|
font-weight: normal;
|
||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
background: #dcdcdc;
|
background: #dcdcdc;
|
||||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#dcdcdc));
|
background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#dcdcdc));
|
||||||
|
@ -515,8 +515,8 @@ input[type=submit],
|
||||||
background-image: -ms-linear-gradient(top, #fefefe, #dcdcdc);
|
background-image: -ms-linear-gradient(top, #fefefe, #dcdcdc);
|
||||||
background-image: -o-linear-gradient(top, #fefefe, #dcdcdc);
|
background-image: -o-linear-gradient(top, #fefefe, #dcdcdc);
|
||||||
background-image: linear-gradient(top, #fefefe, #dcdcdc);
|
background-image: linear-gradient(top, #fefefe, #dcdcdc);
|
||||||
color:#333;
|
color: #333;
|
||||||
border:1px solid #bbb;
|
border: 1px solid #bbb;
|
||||||
-webkit-border-radius: 4px;
|
-webkit-border-radius: 4px;
|
||||||
-moz-border-radius: 4px;
|
-moz-border-radius: 4px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
@ -661,50 +661,50 @@ pre {
|
||||||
background-color: rgba(255, 255, 0, 0.5);
|
background-color: rgba(255, 255, 0, 0.5);
|
||||||
}
|
}
|
||||||
.code-coverage-results div.code-line {
|
.code-coverage-results div.code-line {
|
||||||
padding-left:5px;
|
padding-left: 5px;
|
||||||
display:block;
|
display: block;
|
||||||
margin-left:10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
.code-coverage-results div.uncovered span.content {
|
.code-coverage-results div.uncovered span.content {
|
||||||
background:#ecc;
|
background: #ecc;
|
||||||
}
|
}
|
||||||
.code-coverage-results div.covered span.content {
|
.code-coverage-results div.covered span.content {
|
||||||
background:#cec;
|
background: #cec;
|
||||||
}
|
}
|
||||||
.code-coverage-results div.ignored span.content {
|
.code-coverage-results div.ignored span.content {
|
||||||
color:#aaa;
|
color: #aaa;
|
||||||
}
|
}
|
||||||
.code-coverage-results span.line-num {
|
.code-coverage-results span.line-num {
|
||||||
color:#666;
|
color: #666;
|
||||||
display:block;
|
display: block;
|
||||||
float:left;
|
float: left;
|
||||||
width:20px;
|
width: 20px;
|
||||||
text-align:right;
|
text-align: right;
|
||||||
margin-right:5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
.code-coverage-results span.line-num strong {
|
.code-coverage-results span.line-num strong {
|
||||||
color:#666;
|
color: #666;
|
||||||
}
|
}
|
||||||
.code-coverage-results div.start {
|
.code-coverage-results div.start {
|
||||||
border:1px solid #aaa;
|
border: 1px solid #aaa;
|
||||||
border-width:1px 1px 0px 1px;
|
border-width: 1px 1px 0px 1px;
|
||||||
margin-top:30px;
|
margin-top: 30px;
|
||||||
padding-top:5px;
|
padding-top: 5px;
|
||||||
}
|
}
|
||||||
.code-coverage-results div.end {
|
.code-coverage-results div.end {
|
||||||
border:1px solid #aaa;
|
border: 1px solid #aaa;
|
||||||
border-width:0px 1px 1px 1px;
|
border-width: 0px 1px 1px 1px;
|
||||||
margin-bottom:30px;
|
margin-bottom: 30px;
|
||||||
padding-bottom:5px;
|
padding-bottom: 5px;
|
||||||
}
|
}
|
||||||
.code-coverage-results div.realstart {
|
.code-coverage-results div.realstart {
|
||||||
margin-top:0px;
|
margin-top: 0px;
|
||||||
}
|
}
|
||||||
.code-coverage-results p.note {
|
.code-coverage-results p.note {
|
||||||
color:#bbb;
|
color: #bbb;
|
||||||
padding:5px;
|
padding: 5px;
|
||||||
margin:5px 0 10px;
|
margin: 5px 0 10px;
|
||||||
font-size:10px;
|
font-size: 10px;
|
||||||
}
|
}
|
||||||
.code-coverage-results span.result-bad {
|
.code-coverage-results span.result-bad {
|
||||||
color: #a00;
|
color: #a00;
|
||||||
|
@ -718,5 +718,5 @@ pre {
|
||||||
|
|
||||||
/** Elements **/
|
/** Elements **/
|
||||||
#url-rewriting-warning {
|
#url-rewriting-warning {
|
||||||
display:none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -511,7 +511,7 @@ class I18n {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mustEscape = array($escape . ',' , $escape . ';', $escape . '<', $escape . '>', $escape . $escape);
|
$mustEscape = array($escape . ',', $escape . ';', $escape . '<', $escape . '>', $escape . $escape);
|
||||||
$replacements = array_map('crc32', $mustEscape);
|
$replacements = array_map('crc32', $mustEscape);
|
||||||
$value = str_replace($mustEscape, $replacements, $value);
|
$value = str_replace($mustEscape, $replacements, $value);
|
||||||
$value = explode(';', $value);
|
$value = explode(';', $value);
|
||||||
|
|
|
@ -349,7 +349,7 @@ class ContainableBehavior extends ModelBehavior {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($containments['models'][$Model->alias])) {
|
if (!isset($containments['models'][$Model->alias])) {
|
||||||
$containments['models'][$Model->alias] = array('keep' => array(),'instance' => &$Model);
|
$containments['models'][$Model->alias] = array('keep' => array(), 'instance' => &$Model);
|
||||||
}
|
}
|
||||||
|
|
||||||
$containments['models'][$Model->alias]['keep'] = array_merge($containments['models'][$Model->alias]['keep'], $keep);
|
$containments['models'][$Model->alias]['keep'] = array_merge($containments['models'][$Model->alias]['keep'], $keep);
|
||||||
|
|
|
@ -38,7 +38,7 @@ class TranslateBehavior extends ModelBehavior {
|
||||||
* Callback
|
* Callback
|
||||||
*
|
*
|
||||||
* $config for TranslateBehavior should be
|
* $config for TranslateBehavior should be
|
||||||
* array( 'fields' => array('field_one',
|
* array('fields' => array('field_one',
|
||||||
* 'field_two' => 'FieldAssoc', 'field_three'))
|
* 'field_two' => 'FieldAssoc', 'field_three'))
|
||||||
*
|
*
|
||||||
* With above example only one permanent hasMany will be joined (for field_two
|
* With above example only one permanent hasMany will be joined (for field_two
|
||||||
|
|
|
@ -402,7 +402,7 @@ class CakeSchema extends Object {
|
||||||
if ($field != 'indexes' && $field != 'tableParameters') {
|
if ($field != 'indexes' && $field != 'tableParameters') {
|
||||||
if (is_string($value)) {
|
if (is_string($value)) {
|
||||||
$type = $value;
|
$type = $value;
|
||||||
$value = array('type'=> $type);
|
$value = array('type' => $type);
|
||||||
}
|
}
|
||||||
$col = "\t\t'{$field}' => array('type' => '" . $value['type'] . "', ";
|
$col = "\t\t'{$field}' => array('type' => '" . $value['type'] . "', ";
|
||||||
unset($value['type']);
|
unset($value['type']);
|
||||||
|
|
|
@ -297,7 +297,7 @@ class Sqlite extends DboSource {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (preg_match('/\bAS\s+(.*)/i', $selects[$j], $matches)) {
|
if (preg_match('/\bAS\s+(.*)/i', $selects[$j], $matches)) {
|
||||||
$columnName = trim($matches[1],'"');
|
$columnName = trim($matches[1], '"');
|
||||||
} else {
|
} else {
|
||||||
$columnName = trim(str_replace('"', '', $selects[$j]));
|
$columnName = trim(str_replace('"', '', $selects[$j]));
|
||||||
}
|
}
|
||||||
|
|
|
@ -2877,7 +2877,7 @@ class DboSource extends DataSource {
|
||||||
/**
|
/**
|
||||||
* Generate a database-native column schema string
|
* Generate a database-native column schema string
|
||||||
*
|
*
|
||||||
* @param array $column An array structured like the following: array('name'=>'value', 'type'=>'value'[, options]),
|
* @param array $column An array structured like the following: array('name' => 'value', 'type' => 'value'[, options]),
|
||||||
* where options can be 'default', 'length', or 'key'.
|
* where options can be 'default', 'length', or 'key'.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
@ -2911,7 +2911,7 @@ class DboSource extends DataSource {
|
||||||
$out .= '(' . $length . ')';
|
$out .= '(' . $length . ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($column['type'] === 'integer' || $column['type'] === 'float' ) && isset($column['default']) && $column['default'] === '') {
|
if (($column['type'] === 'integer' || $column['type'] === 'float') && isset($column['default']) && $column['default'] === '') {
|
||||||
$column['default'] = null;
|
$column['default'] = null;
|
||||||
}
|
}
|
||||||
$out = $this->_buildFieldParameters($out, $column, 'beforeDefault');
|
$out = $this->_buildFieldParameters($out, $column, 'beforeDefault');
|
||||||
|
|
|
@ -537,7 +537,7 @@ class Model extends Object {
|
||||||
*/
|
*/
|
||||||
protected $_associationKeys = array(
|
protected $_associationKeys = array(
|
||||||
'belongsTo' => array('className', 'foreignKey', 'conditions', 'fields', 'order', 'counterCache'),
|
'belongsTo' => array('className', 'foreignKey', 'conditions', 'fields', 'order', 'counterCache'),
|
||||||
'hasOne' => array('className', 'foreignKey','conditions', 'fields','order', 'dependent'),
|
'hasOne' => array('className', 'foreignKey', 'conditions', 'fields', 'order', 'dependent'),
|
||||||
'hasMany' => array('className', 'foreignKey', 'conditions', 'fields', 'order', 'limit', 'offset', 'dependent', 'exclusive', 'finderQuery', 'counterQuery'),
|
'hasMany' => array('className', 'foreignKey', 'conditions', 'fields', 'order', 'limit', 'offset', 'dependent', 'exclusive', 'finderQuery', 'counterQuery'),
|
||||||
'hasAndBelongsToMany' => array('className', 'joinTable', 'with', 'foreignKey', 'associationForeignKey', 'conditions', 'fields', 'order', 'limit', 'offset', 'unique', 'finderQuery', 'deleteQuery', 'insertQuery')
|
'hasAndBelongsToMany' => array('className', 'joinTable', 'with', 'foreignKey', 'associationForeignKey', 'conditions', 'fields', 'order', 'limit', 'offset', 'unique', 'finderQuery', 'deleteQuery', 'insertQuery')
|
||||||
);
|
);
|
||||||
|
|
|
@ -256,7 +256,7 @@ class BasicsTest extends CakeTestCase {
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = am(array('one' => array(2, 3), 'two' => array('foo')), array('one' => array(4, 5)));
|
$result = am(array('one' => array(2, 3), 'two' => array('foo')), array('one' => array(4, 5)));
|
||||||
$expected = array('one' => array(4, 5),'two' => array('foo'));
|
$expected = array('one' => array(4, 5), 'two' => array('foo'));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -161,10 +161,10 @@ class CacheTest extends CakeTestCase {
|
||||||
$_cacheConfigSessions = Cache::config('sessions');
|
$_cacheConfigSessions = Cache::config('sessions');
|
||||||
$_cacheConfigTests = Cache::config('tests');
|
$_cacheConfigTests = Cache::config('tests');
|
||||||
|
|
||||||
$result = Cache::config('sessions', array('engine'=> 'File', 'path' => TMP . 'sessions'));
|
$result = Cache::config('sessions', array('engine' => 'File', 'path' => TMP . 'sessions'));
|
||||||
$this->assertEquals($result['settings'], Cache::settings('sessions'));
|
$this->assertEquals($result['settings'], Cache::settings('sessions'));
|
||||||
|
|
||||||
$result = Cache::config('tests', array('engine'=> 'File', 'path' => TMP . 'tests'));
|
$result = Cache::config('tests', array('engine' => 'File', 'path' => TMP . 'tests'));
|
||||||
$this->assertEquals($result['settings'], Cache::settings('tests'));
|
$this->assertEquals($result['settings'], Cache::settings('tests'));
|
||||||
|
|
||||||
Cache::config('sessions', $_cacheConfigSessions['settings']);
|
Cache::config('sessions', $_cacheConfigSessions['settings']);
|
||||||
|
@ -335,7 +335,7 @@ class CacheTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testCacheDisable() {
|
public function testCacheDisable() {
|
||||||
Configure::write('Cache.disable', false);
|
Configure::write('Cache.disable', false);
|
||||||
Cache::config('test_cache_disable_1', array('engine'=> 'File', 'path' => TMP . 'tests'));
|
Cache::config('test_cache_disable_1', array('engine' => 'File', 'path' => TMP . 'tests'));
|
||||||
|
|
||||||
$this->assertTrue(Cache::write('key_1', 'hello', 'test_cache_disable_1'));
|
$this->assertTrue(Cache::write('key_1', 'hello', 'test_cache_disable_1'));
|
||||||
$this->assertSame(Cache::read('key_1', 'test_cache_disable_1'), 'hello');
|
$this->assertSame(Cache::read('key_1', 'test_cache_disable_1'), 'hello');
|
||||||
|
@ -351,7 +351,7 @@ class CacheTest extends CakeTestCase {
|
||||||
$this->assertSame(Cache::read('key_3', 'test_cache_disable_1'), 'hello');
|
$this->assertSame(Cache::read('key_3', 'test_cache_disable_1'), 'hello');
|
||||||
|
|
||||||
Configure::write('Cache.disable', true);
|
Configure::write('Cache.disable', true);
|
||||||
Cache::config('test_cache_disable_2', array('engine'=> 'File', 'path' => TMP . 'tests'));
|
Cache::config('test_cache_disable_2', array('engine' => 'File', 'path' => TMP . 'tests'));
|
||||||
|
|
||||||
$this->assertFalse(Cache::write('key_4', 'hello', 'test_cache_disable_2'));
|
$this->assertFalse(Cache::write('key_4', 'hello', 'test_cache_disable_2'));
|
||||||
$this->assertFalse(Cache::read('key_4', 'test_cache_disable_2'));
|
$this->assertFalse(Cache::read('key_4', 'test_cache_disable_2'));
|
||||||
|
|
|
@ -61,10 +61,10 @@ class FileEngineTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testCacheDirChange() {
|
public function testCacheDirChange() {
|
||||||
$result = Cache::config('sessions', array('engine'=> 'File', 'path' => TMP . 'sessions'));
|
$result = Cache::config('sessions', array('engine' => 'File', 'path' => TMP . 'sessions'));
|
||||||
$this->assertEquals($result['settings'], Cache::settings('sessions'));
|
$this->assertEquals($result['settings'], Cache::settings('sessions'));
|
||||||
|
|
||||||
$result = Cache::config('sessions', array('engine'=> 'File', 'path' => TMP . 'tests'));
|
$result = Cache::config('sessions', array('engine' => 'File', 'path' => TMP . 'tests'));
|
||||||
$this->assertEquals($result['settings'], Cache::settings('sessions'));
|
$this->assertEquals($result['settings'], Cache::settings('sessions'));
|
||||||
$this->assertNotEquals($result['settings'], Cache::settings('default'));
|
$this->assertNotEquals($result['settings'], Cache::settings('default'));
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ class FileEngineTest extends CakeTestCase {
|
||||||
public function testRemoveWindowsSlashesFromCache() {
|
public function testRemoveWindowsSlashesFromCache() {
|
||||||
Cache::config('windows_test', array('engine' => 'File', 'isWindows' => true, 'prefix' => null, 'path' => TMP));
|
Cache::config('windows_test', array('engine' => 'File', 'isWindows' => true, 'prefix' => null, 'path' => TMP));
|
||||||
|
|
||||||
$expected = array (
|
$expected = array(
|
||||||
'C:\dev\prj2\sites\cake\libs' => array(
|
'C:\dev\prj2\sites\cake\libs' => array(
|
||||||
0 => 'C:\dev\prj2\sites\cake\libs', 1 => 'C:\dev\prj2\sites\cake\libs\view',
|
0 => 'C:\dev\prj2\sites\cake\libs', 1 => 'C:\dev\prj2\sites\cake\libs\view',
|
||||||
2 => 'C:\dev\prj2\sites\cake\libs\view\scaffolds', 3 => 'C:\dev\prj2\sites\cake\libs\view\pages',
|
2 => 'C:\dev\prj2\sites\cake\libs\view\scaffolds', 3 => 'C:\dev\prj2\sites\cake\libs\view\pages',
|
||||||
|
|
|
@ -81,7 +81,7 @@ class MemcacheEngineTest extends CakeTestCase {
|
||||||
unset($settings['serialize'], $settings['path']);
|
unset($settings['serialize'], $settings['path']);
|
||||||
$expecting = array(
|
$expecting = array(
|
||||||
'prefix' => 'cake_',
|
'prefix' => 'cake_',
|
||||||
'duration'=> 3600,
|
'duration' => 3600,
|
||||||
'probability' => 100,
|
'probability' => 100,
|
||||||
'servers' => array('127.0.0.1'),
|
'servers' => array('127.0.0.1'),
|
||||||
'persistent' => true,
|
'persistent' => true,
|
||||||
|
@ -312,12 +312,12 @@ class MemcacheEngineTest extends CakeTestCase {
|
||||||
public function testConfigurationConflict() {
|
public function testConfigurationConflict() {
|
||||||
Cache::config('long_memcache', array(
|
Cache::config('long_memcache', array(
|
||||||
'engine' => 'Memcache',
|
'engine' => 'Memcache',
|
||||||
'duration'=> '+2 seconds',
|
'duration' => '+2 seconds',
|
||||||
'servers' => array('127.0.0.1:11211'),
|
'servers' => array('127.0.0.1:11211'),
|
||||||
));
|
));
|
||||||
Cache::config('short_memcache', array(
|
Cache::config('short_memcache', array(
|
||||||
'engine' => 'Memcache',
|
'engine' => 'Memcache',
|
||||||
'duration'=> '+1 seconds',
|
'duration' => '+1 seconds',
|
||||||
'servers' => array('127.0.0.1:11211'),
|
'servers' => array('127.0.0.1:11211'),
|
||||||
));
|
));
|
||||||
Cache::config('some_file', array('engine' => 'File'));
|
Cache::config('some_file', array('engine' => 'File'));
|
||||||
|
|
|
@ -59,7 +59,7 @@ class XcacheEngineTest extends CakeTestCase {
|
||||||
$settings = Cache::settings();
|
$settings = Cache::settings();
|
||||||
$expecting = array(
|
$expecting = array(
|
||||||
'prefix' => 'cake_',
|
'prefix' => 'cake_',
|
||||||
'duration'=> 3600,
|
'duration' => 3600,
|
||||||
'probability' => 100,
|
'probability' => 100,
|
||||||
'engine' => 'Xcache',
|
'engine' => 'Xcache',
|
||||||
);
|
);
|
||||||
|
|
|
@ -782,7 +782,7 @@ class AuthComponentTest extends CakeTestCase {
|
||||||
$this->Auth->Session->delete('Auth');
|
$this->Auth->Session->delete('Auth');
|
||||||
$_SERVER['HTTP_REFERER'] = $_ENV['HTTP_REFERER'] = Router::url('/admin', true);
|
$_SERVER['HTTP_REFERER'] = $_ENV['HTTP_REFERER'] = Router::url('/admin', true);
|
||||||
$this->Auth->Session->write('Auth', array(
|
$this->Auth->Session->write('Auth', array(
|
||||||
'AuthUser' => array('id'=>'1', 'username' => 'nate')
|
'AuthUser' => array('id' => '1', 'username' => 'nate')
|
||||||
));
|
));
|
||||||
$this->Auth->request->params['action'] = 'login';
|
$this->Auth->request->params['action'] = 'login';
|
||||||
$this->Auth->request->url = 'auth_test/login';
|
$this->Auth->request->url = 'auth_test/login';
|
||||||
|
|
|
@ -102,12 +102,12 @@ class CookieComponentTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _setCookieData() {
|
protected function _setCookieData() {
|
||||||
$this->Cookie->write(array('Encrytped_array' => array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!')));
|
$this->Cookie->write(array('Encrytped_array' => array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')));
|
||||||
$this->Cookie->write(array('Encrytped_multi_cookies.name' => 'CakePHP'));
|
$this->Cookie->write(array('Encrytped_multi_cookies.name' => 'CakePHP'));
|
||||||
$this->Cookie->write(array('Encrytped_multi_cookies.version' => '1.2.0.x'));
|
$this->Cookie->write(array('Encrytped_multi_cookies.version' => '1.2.0.x'));
|
||||||
$this->Cookie->write(array('Encrytped_multi_cookies.tag' => 'CakePHP Rocks!'));
|
$this->Cookie->write(array('Encrytped_multi_cookies.tag' => 'CakePHP Rocks!'));
|
||||||
|
|
||||||
$this->Cookie->write(array('Plain_array' => array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!')), null, false);
|
$this->Cookie->write(array('Plain_array' => array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')), null, false);
|
||||||
$this->Cookie->write(array('Plain_multi_cookies.name' => 'CakePHP'), null, false);
|
$this->Cookie->write(array('Plain_multi_cookies.name' => 'CakePHP'), null, false);
|
||||||
$this->Cookie->write(array('Plain_multi_cookies.version' => '1.2.0.x'), null, false);
|
$this->Cookie->write(array('Plain_multi_cookies.version' => '1.2.0.x'), null, false);
|
||||||
$this->Cookie->write(array('Plain_multi_cookies.tag' => 'CakePHP Rocks!'), null, false);
|
$this->Cookie->write(array('Plain_multi_cookies.tag' => 'CakePHP Rocks!'), null, false);
|
||||||
|
@ -145,11 +145,11 @@ class CookieComponentTest extends CakeTestCase {
|
||||||
public function testReadEncryptedCookieData() {
|
public function testReadEncryptedCookieData() {
|
||||||
$this->_setCookieData();
|
$this->_setCookieData();
|
||||||
$data = $this->Cookie->read('Encrytped_array');
|
$data = $this->Cookie->read('Encrytped_array');
|
||||||
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!');
|
||||||
$this->assertEquals($data, $expected);
|
$this->assertEquals($data, $expected);
|
||||||
|
|
||||||
$data = $this->Cookie->read('Encrytped_multi_cookies');
|
$data = $this->Cookie->read('Encrytped_multi_cookies');
|
||||||
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!');
|
||||||
$this->assertEquals($data, $expected);
|
$this->assertEquals($data, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,11 +162,11 @@ class CookieComponentTest extends CakeTestCase {
|
||||||
$this->_setCookieData();
|
$this->_setCookieData();
|
||||||
|
|
||||||
$data = $this->Cookie->read('Plain_array');
|
$data = $this->Cookie->read('Plain_array');
|
||||||
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!');
|
||||||
$this->assertEquals($data, $expected);
|
$this->assertEquals($data, $expected);
|
||||||
|
|
||||||
$data = $this->Cookie->read('Plain_multi_cookies');
|
$data = $this->Cookie->read('Plain_multi_cookies');
|
||||||
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!');
|
||||||
$this->assertEquals($data, $expected);
|
$this->assertEquals($data, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ class CookieComponentTest extends CakeTestCase {
|
||||||
$this->_setCookieData();
|
$this->_setCookieData();
|
||||||
$this->Cookie->delete('Encrytped_multi_cookies.name');
|
$this->Cookie->delete('Encrytped_multi_cookies.name');
|
||||||
$data = $this->Cookie->read('Encrytped_multi_cookies');
|
$data = $this->Cookie->read('Encrytped_multi_cookies');
|
||||||
$expected = array('version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
$expected = array('version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!');
|
||||||
$this->assertEquals($data, $expected);
|
$this->assertEquals($data, $expected);
|
||||||
|
|
||||||
$this->Cookie->delete('Encrytped_array');
|
$this->Cookie->delete('Encrytped_array');
|
||||||
|
@ -288,7 +288,7 @@ class CookieComponentTest extends CakeTestCase {
|
||||||
|
|
||||||
$this->Cookie->delete('Plain_multi_cookies.name');
|
$this->Cookie->delete('Plain_multi_cookies.name');
|
||||||
$data = $this->Cookie->read('Plain_multi_cookies');
|
$data = $this->Cookie->read('Plain_multi_cookies');
|
||||||
$expected = array('version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
$expected = array('version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!');
|
||||||
$this->assertEquals($data, $expected);
|
$this->assertEquals($data, $expected);
|
||||||
|
|
||||||
$this->Cookie->delete('Plain_array');
|
$this->Cookie->delete('Plain_array');
|
||||||
|
@ -372,7 +372,7 @@ class CookieComponentTest extends CakeTestCase {
|
||||||
$this->assertNull($data);
|
$this->assertNull($data);
|
||||||
|
|
||||||
$_COOKIE['CakeTestCookie'] = array(
|
$_COOKIE['CakeTestCookie'] = array(
|
||||||
'Encrytped_array' => $this->__encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!')),
|
'Encrytped_array' => $this->__encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')),
|
||||||
'Encrytped_multi_cookies' => array(
|
'Encrytped_multi_cookies' => array(
|
||||||
'name' => $this->__encrypt('CakePHP'),
|
'name' => $this->__encrypt('CakePHP'),
|
||||||
'version' => $this->__encrypt('1.2.0.x'),
|
'version' => $this->__encrypt('1.2.0.x'),
|
||||||
|
@ -386,19 +386,19 @@ class CookieComponentTest extends CakeTestCase {
|
||||||
$this->Cookie->startup(null);
|
$this->Cookie->startup(null);
|
||||||
|
|
||||||
$data = $this->Cookie->read('Encrytped_array');
|
$data = $this->Cookie->read('Encrytped_array');
|
||||||
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!');
|
||||||
$this->assertEquals($expected, $data);
|
$this->assertEquals($expected, $data);
|
||||||
|
|
||||||
$data = $this->Cookie->read('Encrytped_multi_cookies');
|
$data = $this->Cookie->read('Encrytped_multi_cookies');
|
||||||
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!');
|
||||||
$this->assertEquals($expected, $data);
|
$this->assertEquals($expected, $data);
|
||||||
|
|
||||||
$data = $this->Cookie->read('Plain_array');
|
$data = $this->Cookie->read('Plain_array');
|
||||||
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!');
|
||||||
$this->assertEquals($expected, $data);
|
$this->assertEquals($expected, $data);
|
||||||
|
|
||||||
$data = $this->Cookie->read('Plain_multi_cookies');
|
$data = $this->Cookie->read('Plain_multi_cookies');
|
||||||
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!');
|
||||||
$this->assertEquals($expected, $data);
|
$this->assertEquals($expected, $data);
|
||||||
$this->Cookie->destroy();
|
$this->Cookie->destroy();
|
||||||
unset($_COOKIE['CakeTestCookie']);
|
unset($_COOKIE['CakeTestCookie']);
|
||||||
|
@ -427,7 +427,7 @@ class CookieComponentTest extends CakeTestCase {
|
||||||
$this->assertEquals($expected, $data);
|
$this->assertEquals($expected, $data);
|
||||||
|
|
||||||
$_COOKIE['CakeTestCookie'] = array(
|
$_COOKIE['CakeTestCookie'] = array(
|
||||||
'Encrytped_array' => $this->__encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!')),
|
'Encrytped_array' => $this->__encrypt(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!')),
|
||||||
'Encrytped_multi_cookies' => array(
|
'Encrytped_multi_cookies' => array(
|
||||||
'name' => $this->__encrypt('CakePHP'),
|
'name' => $this->__encrypt('CakePHP'),
|
||||||
'version' => $this->__encrypt('1.2.0.x'),
|
'version' => $this->__encrypt('1.2.0.x'),
|
||||||
|
@ -439,19 +439,19 @@ class CookieComponentTest extends CakeTestCase {
|
||||||
'tag' => 'CakePHP Rocks!'));
|
'tag' => 'CakePHP Rocks!'));
|
||||||
|
|
||||||
$data = $this->Cookie->read('Encrytped_array');
|
$data = $this->Cookie->read('Encrytped_array');
|
||||||
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!');
|
||||||
$this->assertEquals($expected, $data);
|
$this->assertEquals($expected, $data);
|
||||||
|
|
||||||
$data = $this->Cookie->read('Encrytped_multi_cookies');
|
$data = $this->Cookie->read('Encrytped_multi_cookies');
|
||||||
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!');
|
||||||
$this->assertEquals($expected, $data);
|
$this->assertEquals($expected, $data);
|
||||||
|
|
||||||
$data = $this->Cookie->read('Plain_array');
|
$data = $this->Cookie->read('Plain_array');
|
||||||
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!');
|
||||||
$this->assertEquals($expected, $data);
|
$this->assertEquals($expected, $data);
|
||||||
|
|
||||||
$data = $this->Cookie->read('Plain_multi_cookies');
|
$data = $this->Cookie->read('Plain_multi_cookies');
|
||||||
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' =>'CakePHP Rocks!');
|
$expected = array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!');
|
||||||
$this->assertEquals($expected, $data);
|
$this->assertEquals($expected, $data);
|
||||||
$this->Cookie->destroy();
|
$this->Cookie->destroy();
|
||||||
unset($_COOKIE['CakeTestCookie']);
|
unset($_COOKIE['CakeTestCookie']);
|
||||||
|
|
|
@ -1291,7 +1291,7 @@ class ControllerTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testInvokeActionPrefixProtection() {
|
public function testInvokeActionPrefixProtection() {
|
||||||
Router::reload();
|
Router::reload();
|
||||||
Router::connect('/admin/:controller/:action/*', array('prefix'=>'admin'));
|
Router::connect('/admin/:controller/:action/*', array('prefix' => 'admin'));
|
||||||
|
|
||||||
$url = new CakeRequest('test/admin_add/');
|
$url = new CakeRequest('test/admin_add/');
|
||||||
$url->addParams(array('controller' => 'test_controller', 'action' => 'admin_add'));
|
$url->addParams(array('controller' => 'test_controller', 'action' => 'admin_add'));
|
||||||
|
|
|
@ -161,7 +161,7 @@ class ScaffoldTest extends CakeTestCase {
|
||||||
'pass' => array(),
|
'pass' => array(),
|
||||||
'form' => array(),
|
'form' => array(),
|
||||||
'named' => array(),
|
'named' => array(),
|
||||||
'url' => array('url' =>'admin/scaffold_mock/edit'),
|
'url' => array('url' => 'admin/scaffold_mock/edit'),
|
||||||
'controller' => 'scaffold_mock',
|
'controller' => 'scaffold_mock',
|
||||||
'action' => 'admin_edit',
|
'action' => 'admin_edit',
|
||||||
'admin' => true,
|
'admin' => true,
|
||||||
|
@ -191,7 +191,7 @@ class ScaffoldTest extends CakeTestCase {
|
||||||
'pass' => array(),
|
'pass' => array(),
|
||||||
'form' => array(),
|
'form' => array(),
|
||||||
'named' => array(),
|
'named' => array(),
|
||||||
'url' => array('url' =>'admin/scaffold_mock/edit'),
|
'url' => array('url' => 'admin/scaffold_mock/edit'),
|
||||||
'controller' => 'scaffold_mock',
|
'controller' => 'scaffold_mock',
|
||||||
'action' => 'admin_edit',
|
'action' => 'admin_edit',
|
||||||
'admin' => true,
|
'admin' => true,
|
||||||
|
@ -245,7 +245,7 @@ class ScaffoldTest extends CakeTestCase {
|
||||||
'pass' => array(1),
|
'pass' => array(1),
|
||||||
'form' => array(),
|
'form' => array(),
|
||||||
'named' => array(),
|
'named' => array(),
|
||||||
'url' => array('url' =>'scaffold_mock'),
|
'url' => array('url' => 'scaffold_mock'),
|
||||||
'controller' => 'scaffold_mock',
|
'controller' => 'scaffold_mock',
|
||||||
'action' => 'edit',
|
'action' => 'edit',
|
||||||
);
|
);
|
||||||
|
@ -285,7 +285,7 @@ class ScaffoldTest extends CakeTestCase {
|
||||||
'pass' => array(1),
|
'pass' => array(1),
|
||||||
'form' => array(),
|
'form' => array(),
|
||||||
'named' => array(),
|
'named' => array(),
|
||||||
'url' => array('url' =>'scaffold_mock'),
|
'url' => array('url' => 'scaffold_mock'),
|
||||||
'controller' => 'scaffold_mock',
|
'controller' => 'scaffold_mock',
|
||||||
'action' => 'edit',
|
'action' => 'edit',
|
||||||
);
|
);
|
||||||
|
@ -323,7 +323,7 @@ class ScaffoldTest extends CakeTestCase {
|
||||||
'pass' => array(1),
|
'pass' => array(1),
|
||||||
'form' => array(),
|
'form' => array(),
|
||||||
'named' => array(),
|
'named' => array(),
|
||||||
'url' => array('url' =>'scaffold_mock/edit'),
|
'url' => array('url' => 'scaffold_mock/edit'),
|
||||||
'controller' => 'scaffold_mock',
|
'controller' => 'scaffold_mock',
|
||||||
'action' => 'edit',
|
'action' => 'edit',
|
||||||
);
|
);
|
||||||
|
|
|
@ -2923,7 +2923,7 @@ class ContainableBehaviorTest extends CakeTestCase {
|
||||||
if (!empty($result)) {
|
if (!empty($result)) {
|
||||||
foreach ($result as $i => $article) {
|
foreach ($result as $i => $article) {
|
||||||
foreach ($article['Comment'] as $j => $comment) {
|
foreach ($article['Comment'] as $j => $comment) {
|
||||||
$result[$i]['Comment'][$j] = array_diff_key($comment, array('id'=>true));
|
$result[$i]['Comment'][$j] = array_diff_key($comment, array('id' => true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1053,7 +1053,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
||||||
array($modelClass => array('id' => 3, 'name' => '1.1.1', $parentField => 2, $leftField => 3, $rightField => 4)),
|
array($modelClass => array('id' => 3, 'name' => '1.1.1', $parentField => 2, $leftField => 3, $rightField => 4)),
|
||||||
array($modelClass => array('id' => 4, 'name' => '1.1.2', $parentField => 2, $leftField => 5, $rightField => 6)),
|
array($modelClass => array('id' => 4, 'name' => '1.1.2', $parentField => 2, $leftField => 5, $rightField => 6)),
|
||||||
array($modelClass => array('id' => 5, 'name' => '1.2', $parentField => 1, $leftField => 8, $rightField => 13)),
|
array($modelClass => array('id' => 5, 'name' => '1.2', $parentField => 1, $leftField => 8, $rightField => 13)),
|
||||||
array($modelClass => array( 'id' => 6, 'name' => '1.2.1', $parentField => 5, $leftField => 9, $rightField => 10)),
|
array($modelClass => array('id' => 6, 'name' => '1.2.1', $parentField => 5, $leftField => 9, $rightField => 10)),
|
||||||
array($modelClass => array('id' => 7, 'name' => '1.2.2', $parentField => 5, $leftField => 11, $rightField => 12)));
|
array($modelClass => array('id' => 7, 'name' => '1.2.2', $parentField => 5, $leftField => 11, $rightField => 12)));
|
||||||
$this->assertEquals($total, $expects);
|
$this->assertEquals($total, $expects);
|
||||||
|
|
||||||
|
@ -1149,7 +1149,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
||||||
array($modelClass => array('id' => 3, 'name' => '1.1.1', $parentField => 2, $leftField => 3, $rightField => 4)),
|
array($modelClass => array('id' => 3, 'name' => '1.1.1', $parentField => 2, $leftField => 3, $rightField => 4)),
|
||||||
array($modelClass => array('id' => 4, 'name' => '1.1.2', $parentField => 2, $leftField => 5, $rightField => 6)),
|
array($modelClass => array('id' => 4, 'name' => '1.1.2', $parentField => 2, $leftField => 5, $rightField => 6)),
|
||||||
array($modelClass => array('id' => 5, 'name' => '1.2', $parentField => 1, $leftField => 8, $rightField => 13)),
|
array($modelClass => array('id' => 5, 'name' => '1.2', $parentField => 1, $leftField => 8, $rightField => 13)),
|
||||||
array($modelClass => array( 'id' => 6, 'name' => '1.2.1', $parentField => 5, $leftField => 9, $rightField => 10)),
|
array($modelClass => array('id' => 6, 'name' => '1.2.1', $parentField => 5, $leftField => 9, $rightField => 10)),
|
||||||
array($modelClass => array('id' => 7, 'name' => '1.2.2', $parentField => 5, $leftField => 11, $rightField => 12))
|
array($modelClass => array('id' => 7, 'name' => '1.2.2', $parentField => 5, $leftField => 11, $rightField => 12))
|
||||||
);
|
);
|
||||||
$this->assertEquals($total, $expects);
|
$this->assertEquals($total, $expects);
|
||||||
|
|
|
@ -135,7 +135,7 @@ class TreeBehaviorScopedTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testMoveUpWithScope() {
|
public function testMoveUpWithScope() {
|
||||||
$this->Ad = new Ad();
|
$this->Ad = new Ad();
|
||||||
$this->Ad->Behaviors->attach('Tree', array('scope'=>'Campaign'));
|
$this->Ad->Behaviors->attach('Tree', array('scope' => 'Campaign'));
|
||||||
$this->Ad->moveUp(6);
|
$this->Ad->moveUp(6);
|
||||||
|
|
||||||
$this->Ad->id = 4;
|
$this->Ad->id = 4;
|
||||||
|
|
|
@ -665,7 +665,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
||||||
array(
|
array(
|
||||||
'Apple' => array('id' => 1),
|
'Apple' => array('id' => 1),
|
||||||
'Child' => array(
|
'Child' => array(
|
||||||
array('id' => 2,'name' => 'Bright Red Apple', 'mytime' => '22:57:17'))),
|
array('id' => 2, 'name' => 'Bright Red Apple', 'mytime' => '22:57:17'))),
|
||||||
array(
|
array(
|
||||||
'Apple' => array('id' => 2),
|
'Apple' => array('id' => 2),
|
||||||
'Child' => array(
|
'Child' => array(
|
||||||
|
@ -737,7 +737,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
||||||
array(
|
array(
|
||||||
'Apple' => array('id' => 1),
|
'Apple' => array('id' => 1),
|
||||||
'Child' => array(
|
'Child' => array(
|
||||||
array('id' => 2,'name' => 'Bright Red Apple', 'mytime' => '22:57:17'))),
|
array('id' => 2, 'name' => 'Bright Red Apple', 'mytime' => '22:57:17'))),
|
||||||
array(
|
array(
|
||||||
'Apple' => array('id' => 2),
|
'Apple' => array('id' => 2),
|
||||||
'Child' => array(
|
'Child' => array(
|
||||||
|
@ -807,13 +807,13 @@ class BehaviorCollectionTest extends CakeTestCase {
|
||||||
$expected2 = array(
|
$expected2 = array(
|
||||||
array(
|
array(
|
||||||
'Apple' => array('id' => 1),
|
'Apple' => array('id' => 1),
|
||||||
'Parent' => array('id' => 2,'name' => 'Bright Red Apple', 'mytime' => '22:57:17')),
|
'Parent' => array('id' => 2, 'name' => 'Bright Red Apple', 'mytime' => '22:57:17')),
|
||||||
array(
|
array(
|
||||||
'Apple' => array('id' => 2),
|
'Apple' => array('id' => 2),
|
||||||
'Parent' => array('id' => 1, 'name' => 'Red Apple 1', 'mytime' => '22:57:17')),
|
'Parent' => array('id' => 1, 'name' => 'Red Apple 1', 'mytime' => '22:57:17')),
|
||||||
array(
|
array(
|
||||||
'Apple' => array('id' => 3),
|
'Apple' => array('id' => 3),
|
||||||
'Parent' => array('id' => 2,'name' => 'Bright Red Apple', 'mytime' => '22:57:17'))
|
'Parent' => array('id' => 2, 'name' => 'Bright Red Apple', 'mytime' => '22:57:17'))
|
||||||
);
|
);
|
||||||
$result2 = $Apple->find('all', array(
|
$result2 = $Apple->find('all', array(
|
||||||
'fields' => array('Apple.id', 'Parent.id', 'Parent.name', 'Parent.mytime'),
|
'fields' => array('Apple.id', 'Parent.id', 'Parent.name', 'Parent.mytime'),
|
||||||
|
|
|
@ -1302,7 +1302,7 @@ class MysqlTest extends CakeTestCase {
|
||||||
$this->Model->schema();
|
$this->Model->schema();
|
||||||
$this->_buildRelatedModels($this->Model);
|
$this->_buildRelatedModels($this->Model);
|
||||||
|
|
||||||
$binding = array('type'=>'belongsTo', 'model'=>'TestModel4');
|
$binding = array('type' => 'belongsTo', 'model' => 'TestModel4');
|
||||||
$queryData = array();
|
$queryData = array();
|
||||||
$resultSet = null;
|
$resultSet = null;
|
||||||
$null = null;
|
$null = null;
|
||||||
|
@ -1711,7 +1711,7 @@ class MysqlTest extends CakeTestCase {
|
||||||
$this->Model->schema();
|
$this->Model->schema();
|
||||||
$this->_buildRelatedModels($this->Model);
|
$this->_buildRelatedModels($this->Model);
|
||||||
|
|
||||||
$binding = array('type'=>'hasAndBelongsToMany', 'model'=>'TestModel7');
|
$binding = array('type' => 'hasAndBelongsToMany', 'model' => 'TestModel7');
|
||||||
$queryData = array('conditions' => array('TestModel4.name !=' => 'mariano'));
|
$queryData = array('conditions' => array('TestModel4.name !=' => 'mariano'));
|
||||||
$resultSet = null;
|
$resultSet = null;
|
||||||
$null = null;
|
$null = null;
|
||||||
|
@ -1744,7 +1744,7 @@ class MysqlTest extends CakeTestCase {
|
||||||
$this->Model->hasAndBelongsToMany['TestModel7']['offset'] = 2;
|
$this->Model->hasAndBelongsToMany['TestModel7']['offset'] = 2;
|
||||||
$this->Model->hasAndBelongsToMany['TestModel7']['limit'] = 5;
|
$this->Model->hasAndBelongsToMany['TestModel7']['limit'] = 5;
|
||||||
|
|
||||||
$binding = array('type'=>'hasAndBelongsToMany', 'model'=>'TestModel7');
|
$binding = array('type' => 'hasAndBelongsToMany', 'model' => 'TestModel7');
|
||||||
$queryData = array();
|
$queryData = array();
|
||||||
$resultSet = null;
|
$resultSet = null;
|
||||||
$null = null;
|
$null = null;
|
||||||
|
@ -1780,7 +1780,7 @@ class MysqlTest extends CakeTestCase {
|
||||||
$this->Model->hasAndBelongsToMany['TestModel7']['page'] = 2;
|
$this->Model->hasAndBelongsToMany['TestModel7']['page'] = 2;
|
||||||
$this->Model->hasAndBelongsToMany['TestModel7']['limit'] = 5;
|
$this->Model->hasAndBelongsToMany['TestModel7']['limit'] = 5;
|
||||||
|
|
||||||
$binding = array('type'=>'hasAndBelongsToMany', 'model'=>'TestModel7');
|
$binding = array('type' => 'hasAndBelongsToMany', 'model' => 'TestModel7');
|
||||||
$queryData = array();
|
$queryData = array();
|
||||||
$resultSet = null;
|
$resultSet = null;
|
||||||
$null = null;
|
$null = null;
|
||||||
|
@ -1851,7 +1851,7 @@ class MysqlTest extends CakeTestCase {
|
||||||
$expected = " WHERE score BETWEEN 90.1 AND 95.7";
|
$expected = " WHERE score BETWEEN 90.1 AND 95.7";
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $this->Dbo->conditions(array('score' => array(2=>1, 2, 10)));
|
$result = $this->Dbo->conditions(array('score' => array(2 => 1, 2, 10)));
|
||||||
$expected = " WHERE score IN (1, 2, 10)";
|
$expected = " WHERE score IN (1, 2, 10)";
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
|
|
@ -487,22 +487,22 @@ class PostgresTest extends CakeTestCase {
|
||||||
$schema = new CakeSchema();
|
$schema = new CakeSchema();
|
||||||
$schema->tables = array('i18n' => array(
|
$schema->tables = array('i18n' => array(
|
||||||
'id' => array(
|
'id' => array(
|
||||||
'type' => 'integer', 'null' => false, 'default' => null,
|
'type' => 'integer', 'null' => false, 'default' => null,
|
||||||
'length' => 10, 'key' => 'primary'
|
'length' => 10, 'key' => 'primary'
|
||||||
),
|
),
|
||||||
'locale' => array('type'=>'string', 'null' => false, 'length' => 6, 'key' => 'index'),
|
'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
|
||||||
'model' => array('type'=>'string', 'null' => false, 'key' => 'index'),
|
'model' => array('type' => 'string', 'null' => false, 'key' => 'index'),
|
||||||
'foreign_key' => array(
|
'foreign_key' => array(
|
||||||
'type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'
|
'type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'
|
||||||
),
|
),
|
||||||
'field' => array('type'=>'string', 'null' => false, 'key' => 'index'),
|
'field' => array('type' => 'string', 'null' => false, 'key' => 'index'),
|
||||||
'content' => array('type'=>'text', 'null' => true, 'default' => null),
|
'content' => array('type' => 'text', 'null' => true, 'default' => null),
|
||||||
'indexes' => array(
|
'indexes' => array(
|
||||||
'PRIMARY' => array('column' => 'id', 'unique' => 1),
|
'PRIMARY' => array('column' => 'id', 'unique' => 1),
|
||||||
'locale' => array('column' => 'locale', 'unique' => 0),
|
'locale' => array('column' => 'locale', 'unique' => 0),
|
||||||
'model' => array('column' => 'model', 'unique' => 0),
|
'model' => array('column' => 'model', 'unique' => 0),
|
||||||
'row_id' => array('column' => 'foreign_key', 'unique' => 0),
|
'row_id' => array('column' => 'foreign_key', 'unique' => 0),
|
||||||
'field' => array('column' => 'field', 'unique' => 0)
|
'field' => array('column' => 'field', 'unique' => 0)
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
|
@ -245,13 +245,13 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$this->loadFixtures('Article', 'User');
|
$this->loadFixtures('Article', 'User');
|
||||||
$TestUser =& new User();
|
$TestUser =& new User();
|
||||||
|
|
||||||
$options = array (
|
$options = array(
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'user',
|
'user',
|
||||||
'Article.published',
|
'Article.published',
|
||||||
),
|
),
|
||||||
'joins' => array (
|
'joins' => array(
|
||||||
array (
|
array(
|
||||||
'table' => 'articles',
|
'table' => 'articles',
|
||||||
'alias' => 'Article',
|
'alias' => 'Article',
|
||||||
'type' => 'LEFT',
|
'type' => 'LEFT',
|
||||||
|
@ -678,7 +678,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('mytime'=> ''));
|
$expected = array('Apple' => array('mytime' => ''));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -688,7 +688,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('mytime'=> ''));
|
$expected = array('Apple' => array('mytime' => ''));
|
||||||
$this->assertEquals($TestModel->data, $expected, 'Empty values are not returning properly. %s');
|
$this->assertEquals($TestModel->data, $expected, 'Empty values are not returning properly. %s');
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -698,7 +698,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('mytime'=> '00:00:00'));
|
$expected = array('Apple' => array('mytime' => '00:00:00'));
|
||||||
$this->assertEquals($TestModel->data, $expected, 'Midnight is not returning proper values. %s');
|
$this->assertEquals($TestModel->data, $expected, 'Midnight is not returning proper values. %s');
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -707,7 +707,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('mytime'=> '00:00:00'));
|
$expected = array('Apple' => array('mytime' => '00:00:00'));
|
||||||
$this->assertEquals($TestModel->data, $expected, 'Midnight is not returning proper values. %s');
|
$this->assertEquals($TestModel->data, $expected, 'Midnight is not returning proper values. %s');
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -717,7 +717,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('mytime'=> '03:04:04'));
|
$expected = array('Apple' => array('mytime' => '03:04:04'));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -727,7 +727,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple' => array('mytime'=> '03:04:04'));
|
$expected = array('Apple' => array('mytime' => '03:04:04'));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -737,7 +737,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('mytime'=> '03:04:04'));
|
$expected = array('Apple' => array('mytime' => '03:04:04'));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
$db = ConnectionManager::getDataSource('test');
|
$db = ConnectionManager::getDataSource('test');
|
||||||
|
@ -769,7 +769,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('created'=> ''));
|
$expected = array('Apple' => array('created' => ''));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -779,7 +779,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('date'=> ''));
|
$expected = array('Apple' => array('date' => ''));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -792,7 +792,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('created'=> '2007-08-20 00:00:00'));
|
$expected = array('Apple' => array('created' => '2007-08-20 00:00:00'));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -805,7 +805,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('created'=> '2007-08-20 10:12:00'));
|
$expected = array('Apple' => array('created' => '2007-08-20 10:12:00'));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -818,7 +818,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('created'=> ''));
|
$expected = array('Apple' => array('created' => ''));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -827,7 +827,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('created'=> ''));
|
$expected = array('Apple' => array('created' => ''));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -837,7 +837,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('created'=> ''));
|
$expected = array('Apple' => array('created' => ''));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -850,9 +850,9 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'Apple'=> array(
|
'Apple' => array(
|
||||||
'created'=> '',
|
'created' => '',
|
||||||
'date'=> '2006-12-25'
|
'date' => '2006-12-25'
|
||||||
));
|
));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
|
@ -870,9 +870,9 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'Apple'=> array(
|
'Apple' => array(
|
||||||
'created'=> '2007-08-20 10:12:09',
|
'created' => '2007-08-20 10:12:09',
|
||||||
'date'=> '2006-12-25'
|
'date' => '2006-12-25'
|
||||||
));
|
));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
|
@ -889,7 +889,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('created'=> '', 'date'=> ''));
|
$expected = array('Apple' => array('created' => '', 'date' => ''));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -905,7 +905,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('created'=> '', 'date'=> '2006-12-25'));
|
$expected = array('Apple' => array('created' => '', 'date' => '2006-12-25'));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -915,7 +915,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->data = null;
|
$TestModel->data = null;
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$expected = array('Apple'=> array('date'=> '2006-12-25'));
|
$expected = array('Apple' => array('date' => '2006-12-25'));
|
||||||
$this->assertEquals($TestModel->data, $expected);
|
$this->assertEquals($TestModel->data, $expected);
|
||||||
|
|
||||||
$db = ConnectionManager::getDataSource('test');
|
$db = ConnectionManager::getDataSource('test');
|
||||||
|
@ -1954,7 +1954,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
'default' => null,
|
'default' => null,
|
||||||
'length' => null
|
'length' => null
|
||||||
),
|
),
|
||||||
'updated'=> array(
|
'updated' => array(
|
||||||
'type' => 'datetime',
|
'type' => 'datetime',
|
||||||
'null' => true,
|
'null' => true,
|
||||||
'default' => null,
|
'default' => null,
|
||||||
|
|
|
@ -143,7 +143,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$rows = $Thread->find('all', array(
|
$rows = $Thread->find('all', array(
|
||||||
'group' => 'Thread.project_id',
|
'group' => 'Thread.project_id',
|
||||||
'fields' => array('Thread.project_id', 'COUNT(*) AS total'),
|
'fields' => array('Thread.project_id', 'COUNT(*) AS total'),
|
||||||
'order'=> 'Thread.project_id'
|
'order' => 'Thread.project_id'
|
||||||
));
|
));
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
|
@ -211,19 +211,19 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$expected = array(
|
$expected = array(
|
||||||
array('Product' => array('type' => 'Clothing'), array('price' => 32)),
|
array('Product' => array('type' => 'Clothing'), array('price' => 32)),
|
||||||
array('Product' => array('type' => 'Food'), array('price' => 9)),
|
array('Product' => array('type' => 'Food'), array('price' => 9)),
|
||||||
array('Product' => array('type' => 'Music'), array( 'price' => 4)),
|
array('Product' => array('type' => 'Music'), array('price' => 4)),
|
||||||
array('Product' => array('type' => 'Toy'), array('price' => 3))
|
array('Product' => array('type' => 'Toy'), array('price' => 3))
|
||||||
);
|
);
|
||||||
$result = $Product->find('all',array(
|
$result = $Product->find('all',array(
|
||||||
'fields'=>array('Product.type', 'MIN(Product.price) as price'),
|
'fields' => array('Product.type', 'MIN(Product.price) as price'),
|
||||||
'group'=> 'Product.type',
|
'group' => 'Product.type',
|
||||||
'order' => 'Product.type ASC'
|
'order' => 'Product.type ASC'
|
||||||
));
|
));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $Product->find('all', array(
|
$result = $Product->find('all', array(
|
||||||
'fields'=>array('Product.type', 'MIN(Product.price) as price'),
|
'fields' => array('Product.type', 'MIN(Product.price) as price'),
|
||||||
'group'=> array('Product.type'),
|
'group' => array('Product.type'),
|
||||||
'order' => 'Product.type ASC'));
|
'order' => 'Product.type ASC'));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
@ -386,7 +386,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$result = $TestModel->find('all');
|
$result = $TestModel->find('all');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
array(
|
array(
|
||||||
'Apple' => array (
|
'Apple' => array(
|
||||||
'id' => 1,
|
'id' => 1,
|
||||||
'apple_id' => 2,
|
'apple_id' => 2,
|
||||||
'color' => 'Red 1',
|
'color' => 'Red 1',
|
||||||
|
@ -452,7 +452,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
'mytime' => '22:57:17'
|
'mytime' => '22:57:17'
|
||||||
))),
|
))),
|
||||||
'Sample' => array(
|
'Sample' => array(
|
||||||
'id' =>'',
|
'id' => '',
|
||||||
'apple_id' => '',
|
'apple_id' => '',
|
||||||
'name' => ''
|
'name' => ''
|
||||||
),
|
),
|
||||||
|
@ -1133,7 +1133,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
'mytime' => '22:57:17'
|
'mytime' => '22:57:17'
|
||||||
))),
|
))),
|
||||||
'Sample' => array(
|
'Sample' => array(
|
||||||
'id' =>'',
|
'id' => '',
|
||||||
'apple_id' => '',
|
'apple_id' => '',
|
||||||
'name' => ''
|
'name' => ''
|
||||||
),
|
),
|
||||||
|
@ -1742,7 +1742,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$result = $TestModel->find('all');
|
$result = $TestModel->find('all');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
array(
|
array(
|
||||||
'Apple' => array (
|
'Apple' => array(
|
||||||
'id' => 1,
|
'id' => 1,
|
||||||
'apple_id' => 2,
|
'apple_id' => 2,
|
||||||
'color' => 'Red 1',
|
'color' => 'Red 1',
|
||||||
|
@ -1803,7 +1803,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
'mytime' => '22:57:17'
|
'mytime' => '22:57:17'
|
||||||
))),
|
))),
|
||||||
'Sample' => array(
|
'Sample' => array(
|
||||||
'id' =>'',
|
'id' => '',
|
||||||
'apple_id' => '',
|
'apple_id' => '',
|
||||||
'name' => ''
|
'name' => ''
|
||||||
)),
|
)),
|
||||||
|
@ -2237,7 +2237,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
'mytime' => '22:57:17'
|
'mytime' => '22:57:17'
|
||||||
))),
|
))),
|
||||||
'Sample' => array(
|
'Sample' => array(
|
||||||
'id' =>'',
|
'id' => '',
|
||||||
'apple_id' => '',
|
'apple_id' => '',
|
||||||
'name' => ''
|
'name' => ''
|
||||||
)),
|
)),
|
||||||
|
@ -2646,7 +2646,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
'mytime' => '22:57:17'
|
'mytime' => '22:57:17'
|
||||||
))),
|
))),
|
||||||
'Sample' => array(
|
'Sample' => array(
|
||||||
'id' =>'',
|
'id' => '',
|
||||||
'apple_id' => '',
|
'apple_id' => '',
|
||||||
'name' => ''
|
'name' => ''
|
||||||
)),
|
)),
|
||||||
|
@ -3397,38 +3397,38 @@ class ModelReadTest extends BaseModelTest {
|
||||||
'fields' => 'id, name, parent_id',
|
'fields' => 'id, name, parent_id',
|
||||||
'conditions' => array('Category.id !=' => 1)
|
'conditions' => array('Category.id !=' => 1)
|
||||||
));
|
));
|
||||||
$expected = array (
|
$expected = array(
|
||||||
array ('Category' => array(
|
array('Category' => array(
|
||||||
'id' => '2',
|
'id' => '2',
|
||||||
'name' => 'Category 1.1',
|
'name' => 'Category 1.1',
|
||||||
'parent_id' => '1'
|
'parent_id' => '1'
|
||||||
)),
|
)),
|
||||||
array ('Category' => array(
|
array('Category' => array(
|
||||||
'id' => '3',
|
'id' => '3',
|
||||||
'name' => 'Category 1.2',
|
'name' => 'Category 1.2',
|
||||||
'parent_id' => '1'
|
'parent_id' => '1'
|
||||||
)),
|
)),
|
||||||
array ('Category' => array(
|
array('Category' => array(
|
||||||
'id' => '4',
|
'id' => '4',
|
||||||
'name' => 'Category 2',
|
'name' => 'Category 2',
|
||||||
'parent_id' => '0'
|
'parent_id' => '0'
|
||||||
)),
|
)),
|
||||||
array ('Category' => array(
|
array('Category' => array(
|
||||||
'id' => '5',
|
'id' => '5',
|
||||||
'name' => 'Category 3',
|
'name' => 'Category 3',
|
||||||
'parent_id' => '0'
|
'parent_id' => '0'
|
||||||
)),
|
)),
|
||||||
array ('Category' => array(
|
array('Category' => array(
|
||||||
'id' => '6',
|
'id' => '6',
|
||||||
'name' => 'Category 3.1',
|
'name' => 'Category 3.1',
|
||||||
'parent_id' => '5'
|
'parent_id' => '5'
|
||||||
)),
|
)),
|
||||||
array ('Category' => array(
|
array('Category' => array(
|
||||||
'id' => '7',
|
'id' => '7',
|
||||||
'name' => 'Category 1.1.1',
|
'name' => 'Category 1.1.1',
|
||||||
'parent_id' => '2'
|
'parent_id' => '2'
|
||||||
)),
|
)),
|
||||||
array ('Category' => array(
|
array('Category' => array(
|
||||||
'id' => '8',
|
'id' => '8',
|
||||||
'name' => 'Category 1.1.2',
|
'name' => 'Category 1.1.2',
|
||||||
'parent_id' => '2'
|
'parent_id' => '2'
|
||||||
|
@ -6087,7 +6087,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
'conditions' => array(
|
'conditions' => array(
|
||||||
'user' => 'larry'),
|
'user' => 'larry'),
|
||||||
'fields' => NULL,
|
'fields' => NULL,
|
||||||
'joins' => array (),
|
'joins' => array(),
|
||||||
'limit' => NULL,
|
'limit' => NULL,
|
||||||
'offset' => NULL,
|
'offset' => NULL,
|
||||||
'order' => array(
|
'order' => array(
|
||||||
|
|
|
@ -435,7 +435,7 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$TestModel2->save(array(
|
$TestModel2->save(array(
|
||||||
'name' => 'Item 7',
|
'name' => 'Item 7',
|
||||||
'syfile_id' => 1,
|
'syfile_id' => 1,
|
||||||
'published'=> true
|
'published' => true
|
||||||
));
|
));
|
||||||
|
|
||||||
$result = $TestModel->findById(1);
|
$result = $TestModel->findById(1);
|
||||||
|
@ -450,7 +450,7 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$TestModel2->save(array(
|
$TestModel2->save(array(
|
||||||
'id' => 1,
|
'id' => 1,
|
||||||
'syfile_id' => 1,
|
'syfile_id' => 1,
|
||||||
'published'=> false
|
'published' => false
|
||||||
));
|
));
|
||||||
|
|
||||||
$result = $TestModel->findById(1);
|
$result = $TestModel->findById(1);
|
||||||
|
@ -993,11 +993,11 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$TestModel->recursive = -1;
|
$TestModel->recursive = -1;
|
||||||
$result = $TestModel->find('all', array('fields' => array('id', 'title')));
|
$result = $TestModel->find('all', array('fields' => array('id', 'title')));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
array('Article' => array('id' => 1, 'title' => 'First Article' )),
|
array('Article' => array('id' => 1, 'title' => 'First Article')),
|
||||||
array('Article' => array('id' => 2, 'title' => 'Second Article' )),
|
array('Article' => array('id' => 2, 'title' => 'Second Article')),
|
||||||
array('Article' => array('id' => 3, 'title' => 'Third Article' )),
|
array('Article' => array('id' => 3, 'title' => 'Third Article')),
|
||||||
array('Article' => array('id' => 4, 'title' => 'Fourth Article - New Title' )),
|
array('Article' => array('id' => 4, 'title' => 'Fourth Article - New Title')),
|
||||||
array('Article' => array('id' => 5, 'title' => 'Fifth Article - New Title 5' ))
|
array('Article' => array('id' => 5, 'title' => 'Fifth Article - New Title 5'))
|
||||||
);
|
);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
@ -3661,7 +3661,7 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
1 => array('title' => 'title 1'),
|
1 => array('title' => 'title 1'),
|
||||||
2 => array('title' => 'title 2'),
|
2 => array('title' => 'title 2'),
|
||||||
),
|
),
|
||||||
array('validate'=>'only')
|
array('validate' => 'only')
|
||||||
);
|
);
|
||||||
$this->assertFalse($result);
|
$this->assertFalse($result);
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
@ -3675,7 +3675,7 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
1 => array('title' => ''),
|
1 => array('title' => ''),
|
||||||
2 => array('title' => 'title 2'),
|
2 => array('title' => 'title 2'),
|
||||||
),
|
),
|
||||||
array('validate'=>'only')
|
array('validate' => 'only')
|
||||||
);
|
);
|
||||||
$this->assertFalse($result);
|
$this->assertFalse($result);
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
@ -3778,7 +3778,7 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'body' => 3,
|
'body' => 3,
|
||||||
'published' =>'sd',
|
'published' => 'sd',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
$Something->create();
|
$Something->create();
|
||||||
|
@ -3810,7 +3810,7 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
array(
|
array(
|
||||||
'title' => 'valid',
|
'title' => 'valid',
|
||||||
'body' => 'this body',
|
'body' => 'this body',
|
||||||
'published' =>'sd',
|
'published' => 'sd',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
$Something->create();
|
$Something->create();
|
||||||
|
@ -5083,7 +5083,7 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'body' => 3,
|
'body' => 3,
|
||||||
'published' =>'sd',
|
'published' => 'sd',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
$Something->create();
|
$Something->create();
|
||||||
|
@ -5115,7 +5115,7 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
array(
|
array(
|
||||||
'title' => 'valid',
|
'title' => 'valid',
|
||||||
'body' => 'this body',
|
'body' => 'this body',
|
||||||
'published' =>'sd',
|
'published' => 'sd',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
$Something->create();
|
$Something->create();
|
||||||
|
@ -5305,7 +5305,7 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$results = $ProductUpdateAll->find('all', compact('conditions'));
|
$results = $ProductUpdateAll->find('all', compact('conditions'));
|
||||||
$this->assertTrue(!empty($results));
|
$this->assertTrue(!empty($results));
|
||||||
|
|
||||||
$ProductUpdateAll->bindModel(array('belongsTo'=>array('Group')));
|
$ProductUpdateAll->bindModel(array('belongsTo' => array('Group')));
|
||||||
$ProductUpdateAll->belongsTo = array(
|
$ProductUpdateAll->belongsTo = array(
|
||||||
'Group' => array(
|
'Group' => array(
|
||||||
'className' => 'GroupUpdateAll',
|
'className' => 'GroupUpdateAll',
|
||||||
|
@ -5431,7 +5431,7 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
);
|
);
|
||||||
|
|
||||||
$ProductUpdateAll->updateAll(array('name' => "'new product'"), $conditions);
|
$ProductUpdateAll->updateAll(array('name' => "'new product'"), $conditions);
|
||||||
$resultsFkFalse = $ProductUpdateAll->find('all', array('conditions' => array('ProductUpdateAll.name'=>'new product')));
|
$resultsFkFalse = $ProductUpdateAll->find('all', array('conditions' => array('ProductUpdateAll.name' => 'new product')));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'0' => array(
|
'0' => array(
|
||||||
'ProductUpdateAll' => array(
|
'ProductUpdateAll' => array(
|
||||||
|
|
|
@ -46,12 +46,12 @@ class Test extends CakeTestModel {
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $_schema = array(
|
protected $_schema = array(
|
||||||
'id'=> array('type' => 'integer', 'null' => '', 'default' => '1', 'length' => '8', 'key'=>'primary'),
|
'id' => array('type' => 'integer', 'null' => '', 'default' => '1', 'length' => '8', 'key' => 'primary'),
|
||||||
'name'=> array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
|
'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
|
||||||
'email'=> array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'),
|
'email' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'),
|
||||||
'notes'=> array('type' => 'text', 'null' => '1', 'default' => 'write some notes here', 'length' => ''),
|
'notes' => array('type' => 'text', 'null' => '1', 'default' => 'write some notes here', 'length' => ''),
|
||||||
'created'=> array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''),
|
'created' => array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''),
|
||||||
'updated'=> array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
|
'updated' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,12 +89,12 @@ class TestAlias extends CakeTestModel {
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $_schema = array(
|
protected $_schema = array(
|
||||||
'id'=> array('type' => 'integer', 'null' => '', 'default' => '1', 'length' => '8', 'key'=>'primary'),
|
'id' => array('type' => 'integer', 'null' => '', 'default' => '1', 'length' => '8', 'key' => 'primary'),
|
||||||
'name'=> array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
|
'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
|
||||||
'email'=> array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'),
|
'email' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'),
|
||||||
'notes'=> array('type' => 'text', 'null' => '1', 'default' => 'write some notes here', 'length' => ''),
|
'notes' => array('type' => 'text', 'null' => '1', 'default' => 'write some notes here', 'length' => ''),
|
||||||
'created'=> array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''),
|
'created' => array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''),
|
||||||
'updated'=> array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
|
'updated' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2543,7 +2543,7 @@ class Campaign extends CakeTestModel {
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $hasMany = array('Ad' => array('fields' => array('id','campaign_id','name')));
|
public $hasMany = array('Ad' => array('fields' => array('id', 'campaign_id', 'name')));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3845,7 +3845,7 @@ class Level extends CakeTestModel {
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $hasMany = array(
|
public $hasMany = array(
|
||||||
'Group'=> array(
|
'Group' => array(
|
||||||
'className' => 'Group'
|
'className' => 'Group'
|
||||||
),
|
),
|
||||||
'User2' => array(
|
'User2' => array(
|
||||||
|
@ -4056,9 +4056,9 @@ class Category2 extends CakeTestModel {
|
||||||
),
|
),
|
||||||
'Article2' => array(
|
'Article2' => array(
|
||||||
'className' => 'Article2',
|
'className' => 'Article2',
|
||||||
'order'=>'Article2.published_date DESC',
|
'order' => 'Article2.published_date DESC',
|
||||||
'foreignKey' => 'category_id',
|
'foreignKey' => 'category_id',
|
||||||
'limit'=>'3')
|
'limit' => '3')
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4363,7 +4363,7 @@ class ArticleFeatured2 extends CakeTestModel {
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $hasMany = array(
|
public $hasMany = array(
|
||||||
'Comment2' => array('className'=>'Comment2', 'dependent' => true)
|
'Comment2' => array('className' => 'Comment2', 'dependent' => true)
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -317,7 +317,7 @@ class HttpSocketTest extends CakeTestCase {
|
||||||
'port' => 80,
|
'port' => 80,
|
||||||
'timeout' => 30,
|
'timeout' => 30,
|
||||||
'request' => array(
|
'request' => array(
|
||||||
'uri' => array (
|
'uri' => array(
|
||||||
'scheme' => 'http',
|
'scheme' => 'http',
|
||||||
'host' => 'www.cakephp.org',
|
'host' => 'www.cakephp.org',
|
||||||
'port' => 80
|
'port' => 80
|
||||||
|
|
|
@ -854,8 +854,8 @@ class DispatcherTest extends CakeTestCase {
|
||||||
$result = $Dispatcher->parseParams($url);
|
$result = $Dispatcher->parseParams($url);
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'pass' => array('home'),
|
'pass' => array('home'),
|
||||||
'named' => array('param'=> 'value', 'param2'=> 'value2'), 'plugin'=> 'my_plugin',
|
'named' => array('param' => 'value', 'param2' => 'value2'), 'plugin' => 'my_plugin',
|
||||||
'controller'=> 'some_pages', 'action'=> 'display'
|
'controller' => 'some_pages', 'action' => 'display'
|
||||||
);
|
);
|
||||||
foreach ($expected as $key => $value) {
|
foreach ($expected as $key => $value) {
|
||||||
$this->assertEquals($result[$key], $value, 'Value mismatch ' . $key . ' %');
|
$this->assertEquals($result[$key], $value, 'Value mismatch ' . $key . ' %');
|
||||||
|
@ -864,7 +864,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
$this->assertSame($controller->plugin, 'MyPlugin');
|
$this->assertSame($controller->plugin, 'MyPlugin');
|
||||||
$this->assertSame($controller->name, 'SomePages');
|
$this->assertSame($controller->name, 'SomePages');
|
||||||
$this->assertSame($controller->params['controller'], 'some_pages');
|
$this->assertSame($controller->params['controller'], 'some_pages');
|
||||||
$this->assertSame($controller->passedArgs, array('0' => 'home', 'param'=>'value', 'param2'=>'value2'));
|
$this->assertSame($controller->passedArgs, array('0' => 'home', 'param' => 'value', 'param2' => 'value2'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -969,7 +969,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
$this->assertSame($controller->name, 'MyPlugin');
|
$this->assertSame($controller->name, 'MyPlugin');
|
||||||
$this->assertSame($controller->action, 'admin_add');
|
$this->assertSame($controller->action, 'admin_add');
|
||||||
|
|
||||||
$expected = array(0 => 5, 'param'=>'value', 'param2'=>'value2');
|
$expected = array(0 => 5, 'param' => 'value', 'param2' => 'value2');
|
||||||
$this->assertEquals($controller->passedArgs, $expected);
|
$this->assertEquals($controller->passedArgs, $expected);
|
||||||
|
|
||||||
Configure::write('Routing.prefixes', array('admin'));
|
Configure::write('Routing.prefixes', array('admin'));
|
||||||
|
@ -985,7 +985,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
$this->assertSame($controller->action, 'admin_index');
|
$this->assertSame($controller->action, 'admin_index');
|
||||||
|
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'pass'=> array(),
|
'pass' => array(),
|
||||||
'named' => array(),
|
'named' => array(),
|
||||||
'controller' => 'articles_test',
|
'controller' => 'articles_test',
|
||||||
'plugin' => 'articles_test',
|
'plugin' => 'articles_test',
|
||||||
|
@ -1081,7 +1081,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
$url = new CakeRequest('my_plugin/not_here/param:value/param2:value2');
|
$url = new CakeRequest('my_plugin/not_here/param:value/param2:value2');
|
||||||
$response = $this->getMock('CakeResponse');
|
$response = $this->getMock('CakeResponse');
|
||||||
|
|
||||||
$controller = $Dispatcher->dispatch($url, $response, array('return'=> 1));
|
$controller = $Dispatcher->dispatch($url, $response, array('return' => 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1099,7 +1099,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
$url = new CakeRequest('my_plugin/param:value/param2:value2');
|
$url = new CakeRequest('my_plugin/param:value/param2:value2');
|
||||||
$response = $this->getMock('CakeResponse');
|
$response = $this->getMock('CakeResponse');
|
||||||
|
|
||||||
$controller = $Dispatcher->dispatch($url, $response, array('return'=> 1));
|
$controller = $Dispatcher->dispatch($url, $response, array('return' => 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1141,7 +1141,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
$url = new CakeRequest('some_posts/index/param:value/param2:value2');
|
$url = new CakeRequest('some_posts/index/param:value/param2:value2');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$controller = $Dispatcher->dispatch($url, $response, array('return'=> 1));
|
$controller = $Dispatcher->dispatch($url, $response, array('return' => 1));
|
||||||
$this->fail('No exception.');
|
$this->fail('No exception.');
|
||||||
} catch (MissingActionException $e) {
|
} catch (MissingActionException $e) {
|
||||||
$this->assertEquals('Action SomePostsController::view() could not be found.', $e->getMessage());
|
$this->assertEquals('Action SomePostsController::view() could not be found.', $e->getMessage());
|
||||||
|
@ -1487,10 +1487,10 @@ class DispatcherTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function __backupEnvironment() {
|
function __backupEnvironment() {
|
||||||
return array(
|
return array(
|
||||||
'App' => Configure::read('App'),
|
'App' => Configure::read('App'),
|
||||||
'GET' => $_GET,
|
'GET' => $_GET,
|
||||||
'POST' => $_POST,
|
'POST' => $_POST,
|
||||||
'SERVER'=> $_SERVER
|
'SERVER' => $_SERVER
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -513,7 +513,7 @@ class RouterTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function testUrlGenerationWithQueryStrings() {
|
public function testUrlGenerationWithQueryStrings() {
|
||||||
$result = Router::url(array('controller' => 'posts', 'action'=>'index', '0', '?' => 'var=test&var2=test2'));
|
$result = Router::url(array('controller' => 'posts', 'action' => 'index', '0', '?' => 'var=test&var2=test2'));
|
||||||
$expected = '/posts/index/0?var=test&var2=test2';
|
$expected = '/posts/index/0?var=test&var2=test2';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
@ -927,31 +927,31 @@ class RouterTest extends CakeTestCase {
|
||||||
|
|
||||||
Router::connect('/posts/:value/:somevalue/:othervalue/*', array('controller' => 'posts', 'action' => 'view'), array('value','somevalue', 'othervalue'));
|
Router::connect('/posts/:value/:somevalue/:othervalue/*', array('controller' => 'posts', 'action' => 'view'), array('value','somevalue', 'othervalue'));
|
||||||
$result = Router::parse('/posts/2007/08/01/title-of-post-here');
|
$result = Router::parse('/posts/2007/08/01/title-of-post-here');
|
||||||
$expected = array('value' => '2007', 'somevalue' => '08', 'othervalue' => '01', 'controller' => 'posts', 'action' => 'view', 'plugin' =>'', 'pass' => array('0' => 'title-of-post-here'), 'named' => array());
|
$expected = array('value' => '2007', 'somevalue' => '08', 'othervalue' => '01', 'controller' => 'posts', 'action' => 'view', 'plugin' => '', 'pass' => array('0' => 'title-of-post-here'), 'named' => array());
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
Router::reload();
|
Router::reload();
|
||||||
Router::connect('/posts/:year/:month/:day/*', array('controller' => 'posts', 'action' => 'view'), array('year' => $Year, 'month' => $Month, 'day' => $Day));
|
Router::connect('/posts/:year/:month/:day/*', array('controller' => 'posts', 'action' => 'view'), array('year' => $Year, 'month' => $Month, 'day' => $Day));
|
||||||
$result = Router::parse('/posts/2007/08/01/title-of-post-here');
|
$result = Router::parse('/posts/2007/08/01/title-of-post-here');
|
||||||
$expected = array('year' => '2007', 'month' => '08', 'day' => '01', 'controller' => 'posts', 'action' => 'view', 'plugin' =>'', 'pass' => array('0' => 'title-of-post-here'), 'named' => array());
|
$expected = array('year' => '2007', 'month' => '08', 'day' => '01', 'controller' => 'posts', 'action' => 'view', 'plugin' => '', 'pass' => array('0' => 'title-of-post-here'), 'named' => array());
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
Router::reload();
|
Router::reload();
|
||||||
Router::connect('/posts/:day/:year/:month/*', array('controller' => 'posts', 'action' => 'view'), array('year' => $Year, 'month' => $Month, 'day' => $Day));
|
Router::connect('/posts/:day/:year/:month/*', array('controller' => 'posts', 'action' => 'view'), array('year' => $Year, 'month' => $Month, 'day' => $Day));
|
||||||
$result = Router::parse('/posts/01/2007/08/title-of-post-here');
|
$result = Router::parse('/posts/01/2007/08/title-of-post-here');
|
||||||
$expected = array('day' => '01', 'year' => '2007', 'month' => '08', 'controller' => 'posts', 'action' => 'view', 'plugin' =>'', 'pass' => array('0' => 'title-of-post-here'), 'named' => array());
|
$expected = array('day' => '01', 'year' => '2007', 'month' => '08', 'controller' => 'posts', 'action' => 'view', 'plugin' => '', 'pass' => array('0' => 'title-of-post-here'), 'named' => array());
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
Router::reload();
|
Router::reload();
|
||||||
Router::connect('/posts/:month/:day/:year/*', array('controller' => 'posts', 'action' => 'view'), array('year' => $Year, 'month' => $Month, 'day' => $Day));
|
Router::connect('/posts/:month/:day/:year/*', array('controller' => 'posts', 'action' => 'view'), array('year' => $Year, 'month' => $Month, 'day' => $Day));
|
||||||
$result = Router::parse('/posts/08/01/2007/title-of-post-here');
|
$result = Router::parse('/posts/08/01/2007/title-of-post-here');
|
||||||
$expected = array('month' => '08', 'day' => '01', 'year' => '2007', 'controller' => 'posts', 'action' => 'view', 'plugin' =>'', 'pass' => array('0' => 'title-of-post-here'), 'named' => array());
|
$expected = array('month' => '08', 'day' => '01', 'year' => '2007', 'controller' => 'posts', 'action' => 'view', 'plugin' => '', 'pass' => array('0' => 'title-of-post-here'), 'named' => array());
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
Router::reload();
|
Router::reload();
|
||||||
Router::connect('/posts/:year/:month/:day/*', array('controller' => 'posts', 'action' => 'view'));
|
Router::connect('/posts/:year/:month/:day/*', array('controller' => 'posts', 'action' => 'view'));
|
||||||
$result = Router::parse('/posts/2007/08/01/title-of-post-here');
|
$result = Router::parse('/posts/2007/08/01/title-of-post-here');
|
||||||
$expected = array('year' => '2007', 'month' => '08', 'day' => '01', 'controller' => 'posts', 'action' => 'view', 'plugin' =>'', 'pass' => array('0' => 'title-of-post-here'), 'named' => array());
|
$expected = array('year' => '2007', 'month' => '08', 'day' => '01', 'controller' => 'posts', 'action' => 'view', 'plugin' => '', 'pass' => array('0' => 'title-of-post-here'), 'named' => array());
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
Router::reload();
|
Router::reload();
|
||||||
|
@ -1261,7 +1261,7 @@ class RouterTest extends CakeTestCase {
|
||||||
require CAKE . 'Config' . DS . 'routes.php';
|
require CAKE . 'Config' . DS . 'routes.php';
|
||||||
|
|
||||||
$result = Router::parse('/posts.rss');
|
$result = Router::parse('/posts.rss');
|
||||||
$expected = array('plugin' => null, 'controller' => 'posts', 'action' => 'index', 'ext' => 'rss', 'pass'=> array(), 'named' => array());
|
$expected = array('plugin' => null, 'controller' => 'posts', 'action' => 'index', 'ext' => 'rss', 'pass' => array(), 'named' => array());
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = Router::parse('/posts/view/1.rss');
|
$result = Router::parse('/posts/view/1.rss');
|
||||||
|
@ -1281,7 +1281,7 @@ class RouterTest extends CakeTestCase {
|
||||||
Router::parseExtensions('rss', 'xml');
|
Router::parseExtensions('rss', 'xml');
|
||||||
|
|
||||||
$result = Router::parse('/posts.xml');
|
$result = Router::parse('/posts.xml');
|
||||||
$expected = array('plugin' => null, 'controller' => 'posts', 'action' => 'index', 'ext' => 'xml', 'pass'=> array(), 'named' => array());
|
$expected = array('plugin' => null, 'controller' => 'posts', 'action' => 'index', 'ext' => 'xml', 'pass' => array(), 'named' => array());
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = Router::parse('/posts.atom?hello=goodbye');
|
$result = Router::parse('/posts.atom?hello=goodbye');
|
||||||
|
@ -1308,25 +1308,25 @@ class RouterTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testQuerystringGeneration() {
|
public function testQuerystringGeneration() {
|
||||||
$result = Router::url(array('controller' => 'posts', 'action'=>'index', '0', '?' => 'var=test&var2=test2'));
|
$result = Router::url(array('controller' => 'posts', 'action' => 'index', '0', '?' => 'var=test&var2=test2'));
|
||||||
$expected = '/posts/index/0?var=test&var2=test2';
|
$expected = '/posts/index/0?var=test&var2=test2';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = Router::url(array('controller' => 'posts', 'action'=>'index', '0', '?' => array('var' => 'test', 'var2' => 'test2')));
|
$result = Router::url(array('controller' => 'posts', 'action' => 'index', '0', '?' => array('var' => 'test', 'var2' => 'test2')));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$expected .= '&more=test+data';
|
$expected .= '&more=test+data';
|
||||||
$result = Router::url(array('controller' => 'posts', 'action'=>'index', '0', '?' => array('var' => 'test', 'var2' => 'test2', 'more' => 'test data')));
|
$result = Router::url(array('controller' => 'posts', 'action' => 'index', '0', '?' => array('var' => 'test', 'var2' => 'test2', 'more' => 'test data')));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
// Test bug #4614
|
// Test bug #4614
|
||||||
$restore = ini_get('arg_separator.output');
|
$restore = ini_get('arg_separator.output');
|
||||||
ini_set('arg_separator.output', '&');
|
ini_set('arg_separator.output', '&');
|
||||||
$result = Router::url(array('controller' => 'posts', 'action'=>'index', '0', '?' => array('var' => 'test', 'var2' => 'test2', 'more' => 'test data')));
|
$result = Router::url(array('controller' => 'posts', 'action' => 'index', '0', '?' => array('var' => 'test', 'var2' => 'test2', 'more' => 'test data')));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
ini_set('arg_separator.output', $restore);
|
ini_set('arg_separator.output', $restore);
|
||||||
|
|
||||||
$result = Router::url(array('controller' => 'posts', 'action'=>'index', '0', '?' => array('var' => 'test', 'var2' => 'test2')), array('escape' => true));
|
$result = Router::url(array('controller' => 'posts', 'action' => 'index', '0', '?' => array('var' => 'test', 'var2' => 'test2')), array('escape' => true));
|
||||||
$expected = '/posts/index/0?var=test&var2=test2';
|
$expected = '/posts/index/0?var=test&var2=test2';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
@ -1378,7 +1378,7 @@ class RouterTest extends CakeTestCase {
|
||||||
|
|
||||||
Router::reload();
|
Router::reload();
|
||||||
extract(Router::getNamedExpressions());
|
extract(Router::getNamedExpressions());
|
||||||
Router::connectNamed(array('file'=> '[\w\.\-]+\.(html|png)'));
|
Router::connectNamed(array('file' => '[\w\.\-]+\.(html|png)'));
|
||||||
Router::connect('/', array('controller' => 'graphs', 'action' => 'index'));
|
Router::connect('/', array('controller' => 'graphs', 'action' => 'index'));
|
||||||
Router::connect('/:id/*', array('controller' => 'graphs', 'action' => 'view'), array('id' => $ID));
|
Router::connect('/:id/*', array('controller' => 'graphs', 'action' => 'view'), array('id' => $ID));
|
||||||
|
|
||||||
|
@ -1418,7 +1418,7 @@ class RouterTest extends CakeTestCase {
|
||||||
Router::setRequestInfo($request);
|
Router::setRequestInfo($request);
|
||||||
|
|
||||||
$result = Router::parse('/admin/controller/index/type:whatever');
|
$result = Router::parse('/admin/controller/index/type:whatever');
|
||||||
$result = Router::url(array('type'=> 'new'));
|
$result = Router::url(array('type' => 'new'));
|
||||||
$expected = "/admin/controller/index/type:new";
|
$expected = "/admin/controller/index/type:new";
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
@ -1739,7 +1739,7 @@ class RouterTest extends CakeTestCase {
|
||||||
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
|
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
|
||||||
|
|
||||||
$result = Router::parse('/');
|
$result = Router::parse('/');
|
||||||
$expected = array('pass'=> array('home'), 'named' => array(), 'plugin' => null, 'controller' => 'pages', 'action' => 'display');
|
$expected = array('pass' => array('home'), 'named' => array(), 'plugin' => null, 'controller' => 'pages', 'action' => 'display');
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = Router::parse('/pages/home/');
|
$result = Router::parse('/pages/home/');
|
||||||
|
@ -1771,7 +1771,7 @@ class RouterTest extends CakeTestCase {
|
||||||
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
|
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
|
||||||
$result = Router::parse('/pages/contact/');
|
$result = Router::parse('/pages/contact/');
|
||||||
|
|
||||||
$expected = array('pass'=>array('contact'), 'named' => array(), 'plugin'=> null, 'controller'=>'pages', 'action'=>'display');
|
$expected = array('pass' => array('contact'), 'named' => array(), 'plugin' => null, 'controller' => 'pages', 'action' => 'display');
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1899,7 +1899,7 @@ class RouterTest extends CakeTestCase {
|
||||||
$expected = array('pass' => array(), 'named' => array(), 'prefix' => 'members', 'plugin' => null, 'controller' => 'posts', 'action' => 'members_index', 'members' => true);
|
$expected = array('pass' => array(), 'named' => array(), 'prefix' => 'members', 'plugin' => null, 'controller' => 'posts', 'action' => 'members_index', 'members' => true);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = Router::url(array('members' => true, 'controller' => 'posts', 'action' =>'index', 'page' => 2));
|
$result = Router::url(array('members' => true, 'controller' => 'posts', 'action' => 'index', 'page' => 2));
|
||||||
$expected = '/base/members/posts/index/page:2';
|
$expected = '/base/members/posts/index/page:2';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ class FileTest extends CakeTestCase {
|
||||||
$result = $this->File->info();
|
$result = $this->File->info();
|
||||||
$expecting = array(
|
$expecting = array(
|
||||||
'dirname' => dirname(__FILE__), 'basename' => basename(__FILE__),
|
'dirname' => dirname(__FILE__), 'basename' => basename(__FILE__),
|
||||||
'extension' => 'php', 'filename' =>'FileTest'
|
'extension' => 'php', 'filename' => 'FileTest'
|
||||||
);
|
);
|
||||||
$this->assertEquals($expecting, $result);
|
$this->assertEquals($expecting, $result);
|
||||||
|
|
||||||
|
|
|
@ -1464,7 +1464,7 @@ class SetTest extends CakeTestCase {
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = Set::extract($a, '{n}.Article.title');
|
$result = Set::extract($a, '{n}.Article.title');
|
||||||
$expected = array( 'Article 1', 'Article 2', 'Article 3' );
|
$expected = array('Article 1', 'Article 2', 'Article 3');
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = Set::extract($a, '1.Article.title');
|
$result = Set::extract($a, '1.Article.title');
|
||||||
|
@ -1491,7 +1491,7 @@ class SetTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = Set::extract($a, '{n}.Article.User.username');
|
$result = Set::extract($a, '{n}.Article.User.username');
|
||||||
$expected = array( 'mariano.iglesias', 'mariano.iglesias', 'phpnut' );
|
$expected = array('mariano.iglesias', 'mariano.iglesias', 'phpnut');
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$a = array(
|
$a = array(
|
||||||
|
@ -1518,7 +1518,7 @@ class SetTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = Set::extract($a, '{n}.Article.Comment.{n}.id');
|
$result = Set::extract($a, '{n}.Article.Comment.{n}.id');
|
||||||
$expected = array (array(10, 11, 12), array(13, 14), null);
|
$expected = array(array(10, 11, 12), array(13, 14), null);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = Set::extract($a, '{n}.Article.Comment.{n}.title');
|
$result = Set::extract($a, '{n}.Article.Comment.{n}.title');
|
||||||
|
@ -1545,7 +1545,7 @@ class SetTest extends CakeTestCase {
|
||||||
|
|
||||||
$a = array(
|
$a = array(
|
||||||
0 => array('pages' => array('name' => 'page')),
|
0 => array('pages' => array('name' => 'page')),
|
||||||
1 => array('fruites'=> array('name' => 'fruit')),
|
1 => array('fruites' => array('name' => 'fruit')),
|
||||||
'test' => array(array('name' => 'jippi')),
|
'test' => array(array('name' => 'jippi')),
|
||||||
'dot.test' => array(array('name' => 'jippi'))
|
'dot.test' => array(array('name' => 'jippi'))
|
||||||
);
|
);
|
||||||
|
@ -1946,11 +1946,11 @@ class SetTest extends CakeTestCase {
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = Set::combine($a, '{n}.User.id', array('{0}: {1}', '{n}.User.Data.user', '{n}.User.Data.name'), '{n}.User.group_id');
|
$result = Set::combine($a, '{n}.User.id', array('{0}: {1}', '{n}.User.Data.user', '{n}.User.Data.name'), '{n}.User.group_id');
|
||||||
$expected = array (
|
$expected = array(
|
||||||
1 => array (
|
1 => array(
|
||||||
2 => 'mariano.iglesias: Mariano Iglesias',
|
2 => 'mariano.iglesias: Mariano Iglesias',
|
||||||
25 => 'gwoo: The Gwoo'),
|
25 => 'gwoo: The Gwoo'),
|
||||||
2 => array (14 => 'phpnut: Larry E. Masters'));
|
2 => array(14 => 'phpnut: Larry E. Masters'));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = Set::combine($a, array('{0}: {1}', '{n}.User.Data.user', '{n}.User.Data.name'), '{n}.User.id');
|
$result = Set::combine($a, array('{0}: {1}', '{n}.User.Data.user', '{n}.User.Data.name'), '{n}.User.id');
|
||||||
|
@ -2024,14 +2024,14 @@ class SetTest extends CakeTestCase {
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'Post' => array('id'=> 1, 'title' => 'First Post'),
|
'Post' => array('id' => 1, 'title' => 'First Post'),
|
||||||
'Comment' => array(
|
'Comment' => array(
|
||||||
array('id'=> 1, 'title' => 'First Comment'),
|
array('id' => 1, 'title' => 'First Comment'),
|
||||||
array('id'=> 2, 'title' => 'Second Comment')
|
array('id' => 2, 'title' => 'Second Comment')
|
||||||
),
|
),
|
||||||
'Tag' => array(
|
'Tag' => array(
|
||||||
array('id'=> 1, 'title' => 'First Tag'),
|
array('id' => 1, 'title' => 'First Tag'),
|
||||||
array('id'=> 2, 'title' => 'Second Tag')
|
array('id' => 2, 'title' => 'Second Tag')
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
$map = Set::map($expected);
|
$map = Set::map($expected);
|
||||||
|
@ -2093,12 +2093,12 @@ class SetTest extends CakeTestCase {
|
||||||
$result = Set::reverse($map);
|
$result = Set::reverse($map);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$expected = array('User' => array('psword'=> 'whatever', 'Icon' => array('id'=> 851)));
|
$expected = array('User' => array('psword' => 'whatever', 'Icon' => array('id' => 851)));
|
||||||
$map = Set::map($expected);
|
$map = Set::map($expected);
|
||||||
$result = Set::reverse($map);
|
$result = Set::reverse($map);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$expected = array('User' => array('psword'=> 'whatever', 'Icon' => array('id'=> 851)));
|
$expected = array('User' => array('psword' => 'whatever', 'Icon' => array('id' => 851)));
|
||||||
$class = new stdClass;
|
$class = new stdClass;
|
||||||
$class->User = new stdClass;
|
$class->User = new stdClass;
|
||||||
$class->User->psword = 'whatever';
|
$class->User->psword = 'whatever';
|
||||||
|
@ -2107,7 +2107,7 @@ class SetTest extends CakeTestCase {
|
||||||
$result = Set::reverse($class);
|
$result = Set::reverse($class);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$expected = array('User' => array('psword'=> 'whatever', 'Icon' => array('id'=> 851), 'Profile' => array('name' => 'Some Name', 'address' => 'Some Address')));
|
$expected = array('User' => array('psword' => 'whatever', 'Icon' => array('id' => 851), 'Profile' => array('name' => 'Some Name', 'address' => 'Some Address')));
|
||||||
$class = new stdClass;
|
$class = new stdClass;
|
||||||
$class->User = new stdClass;
|
$class->User = new stdClass;
|
||||||
$class->User->psword = 'whatever';
|
$class->User->psword = 'whatever';
|
||||||
|
@ -2120,8 +2120,8 @@ class SetTest extends CakeTestCase {
|
||||||
$result = Set::reverse($class);
|
$result = Set::reverse($class);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$expected = array('User' => array('psword'=> 'whatever',
|
$expected = array('User' => array('psword' => 'whatever',
|
||||||
'Icon' => array('id'=> 851),
|
'Icon' => array('id' => 851),
|
||||||
'Profile' => array('name' => 'Some Name', 'address' => 'Some Address'),
|
'Profile' => array('name' => 'Some Name', 'address' => 'Some Address'),
|
||||||
'Comment' => array(
|
'Comment' => array(
|
||||||
array('id' => 1, 'article_id' => 1, 'user_id' => 1, 'comment' => 'First Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:47:23', 'updated' => '2007-03-18 10:49:31'),
|
array('id' => 1, 'article_id' => 1, 'user_id' => 1, 'comment' => 'First Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:47:23', 'updated' => '2007-03-18 10:49:31'),
|
||||||
|
@ -2156,8 +2156,8 @@ class SetTest extends CakeTestCase {
|
||||||
$result = Set::reverse($class);
|
$result = Set::reverse($class);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$expected = array('User' => array('psword'=> 'whatever',
|
$expected = array('User' => array('psword' => 'whatever',
|
||||||
'Icon' => array('id'=> 851),
|
'Icon' => array('id' => 851),
|
||||||
'Profile' => array('name' => 'Some Name', 'address' => 'Some Address'),
|
'Profile' => array('name' => 'Some Name', 'address' => 'Some Address'),
|
||||||
'Comment' => array(
|
'Comment' => array(
|
||||||
array('id' => 1, 'article_id' => 1, 'user_id' => 1, 'comment' => 'First Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:47:23', 'updated' => '2007-03-18 10:49:31'),
|
array('id' => 1, 'article_id' => 1, 'user_id' => 1, 'comment' => 'First Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:47:23', 'updated' => '2007-03-18 10:49:31'),
|
||||||
|
@ -2200,7 +2200,7 @@ class SetTest extends CakeTestCase {
|
||||||
$class->Profile->name = 'Joe Mamma';
|
$class->Profile->name = 'Joe Mamma';
|
||||||
|
|
||||||
$result = Set::reverse($class);
|
$result = Set::reverse($class);
|
||||||
$expected = array('User' => array('id' => '100'), 'someString'=> 'this is some string', 'Profile' => array('name' => 'Joe Mamma'));
|
$expected = array('User' => array('id' => '100'), 'someString' => 'this is some string', 'Profile' => array('name' => 'Joe Mamma'));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$class = new stdClass;
|
$class = new stdClass;
|
||||||
|
@ -2361,7 +2361,7 @@ class SetTest extends CakeTestCase {
|
||||||
),
|
),
|
||||||
'meta' => array(
|
'meta' => array(
|
||||||
'keywords' => array('testing','tests'),
|
'keywords' => array('testing','tests'),
|
||||||
'description'=>'describe me',
|
'description' => 'describe me',
|
||||||
),
|
),
|
||||||
'get_vars' => '',
|
'get_vars' => '',
|
||||||
'post_vars' => array(),
|
'post_vars' => array(),
|
||||||
|
@ -2388,7 +2388,7 @@ class SetTest extends CakeTestCase {
|
||||||
),
|
),
|
||||||
'meta' => array(
|
'meta' => array(
|
||||||
'keywords' => array('testing','tests'),
|
'keywords' => array('testing','tests'),
|
||||||
'description'=>'describe me',
|
'description' => 'describe me',
|
||||||
),
|
),
|
||||||
'get_vars' => '',
|
'get_vars' => '',
|
||||||
'post_vars' => array(),
|
'post_vars' => array(),
|
||||||
|
@ -2715,37 +2715,37 @@ class SetTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testPushDiff() {
|
public function testPushDiff() {
|
||||||
$array1 = array('ModelOne' => array('id'=>1001, 'field_one'=>'a1.m1.f1', 'field_two'=>'a1.m1.f2'));
|
$array1 = array('ModelOne' => array('id' => 1001, 'field_one' => 'a1.m1.f1', 'field_two' => 'a1.m1.f2'));
|
||||||
$array2 = array('ModelTwo' => array('id'=>1002, 'field_one'=>'a2.m2.f1', 'field_two'=>'a2.m2.f2'));
|
$array2 = array('ModelTwo' => array('id' => 1002, 'field_one' => 'a2.m2.f1', 'field_two' => 'a2.m2.f2'));
|
||||||
|
|
||||||
$result = Set::pushDiff($array1, $array2);
|
$result = Set::pushDiff($array1, $array2);
|
||||||
|
|
||||||
$this->assertEquals($result, $array1 + $array2);
|
$this->assertEquals($result, $array1 + $array2);
|
||||||
|
|
||||||
$array3 = array('ModelOne' => array('id'=>1003, 'field_one'=>'a3.m1.f1', 'field_two'=>'a3.m1.f2', 'field_three'=>'a3.m1.f3'));
|
$array3 = array('ModelOne' => array('id' => 1003, 'field_one' => 'a3.m1.f1', 'field_two' => 'a3.m1.f2', 'field_three' => 'a3.m1.f3'));
|
||||||
$result = Set::pushDiff($array1, $array3);
|
$result = Set::pushDiff($array1, $array3);
|
||||||
|
|
||||||
$expected = array('ModelOne' => array('id'=>1001, 'field_one'=>'a1.m1.f1', 'field_two'=>'a1.m1.f2', 'field_three'=>'a3.m1.f3'));
|
$expected = array('ModelOne' => array('id' => 1001, 'field_one' => 'a1.m1.f1', 'field_two' => 'a1.m1.f2', 'field_three' => 'a3.m1.f3'));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
|
||||||
$array1 = array(
|
$array1 = array(
|
||||||
0 => array('ModelOne' => array('id'=>1001, 'field_one'=>'s1.0.m1.f1', 'field_two'=>'s1.0.m1.f2')),
|
0 => array('ModelOne' => array('id' => 1001, 'field_one' => 's1.0.m1.f1', 'field_two' => 's1.0.m1.f2')),
|
||||||
1 => array('ModelTwo' => array('id'=>1002, 'field_one'=>'s1.1.m2.f2', 'field_two'=>'s1.1.m2.f2')));
|
1 => array('ModelTwo' => array('id' => 1002, 'field_one' => 's1.1.m2.f2', 'field_two' => 's1.1.m2.f2')));
|
||||||
$array2 = array(
|
$array2 = array(
|
||||||
0 => array('ModelOne' => array('id'=>1001, 'field_one'=>'s2.0.m1.f1', 'field_two'=>'s2.0.m1.f2')),
|
0 => array('ModelOne' => array('id' => 1001, 'field_one' => 's2.0.m1.f1', 'field_two' => 's2.0.m1.f2')),
|
||||||
1 => array('ModelTwo' => array('id'=>1002, 'field_one'=>'s2.1.m2.f2', 'field_two'=>'s2.1.m2.f2')));
|
1 => array('ModelTwo' => array('id' => 1002, 'field_one' => 's2.1.m2.f2', 'field_two' => 's2.1.m2.f2')));
|
||||||
|
|
||||||
$result = Set::pushDiff($array1, $array2);
|
$result = Set::pushDiff($array1, $array2);
|
||||||
$this->assertEquals($result, $array1);
|
$this->assertEquals($result, $array1);
|
||||||
|
|
||||||
$array3 = array(0 => array('ModelThree' => array('id'=>1003, 'field_one'=>'s3.0.m3.f1', 'field_two'=>'s3.0.m3.f2')));
|
$array3 = array(0 => array('ModelThree' => array('id' => 1003, 'field_one' => 's3.0.m3.f1', 'field_two' => 's3.0.m3.f2')));
|
||||||
|
|
||||||
$result = Set::pushDiff($array1, $array3);
|
$result = Set::pushDiff($array1, $array3);
|
||||||
$expected = array(
|
$expected = array(
|
||||||
0 => array('ModelOne' => array('id'=>1001, 'field_one'=>'s1.0.m1.f1', 'field_two'=>'s1.0.m1.f2'),
|
0 => array('ModelOne' => array('id' => 1001, 'field_one' => 's1.0.m1.f1', 'field_two' => 's1.0.m1.f2'),
|
||||||
'ModelThree' => array('id'=>1003, 'field_one'=>'s3.0.m3.f1', 'field_two'=>'s3.0.m3.f2')),
|
'ModelThree' => array('id' => 1003, 'field_one' => 's3.0.m3.f1', 'field_two' => 's3.0.m3.f2')),
|
||||||
1 => array('ModelTwo' => array('id'=>1002, 'field_one'=>'s1.1.m2.f2', 'field_two'=>'s1.1.m2.f2')));
|
1 => array('ModelTwo' => array('id' => 1002, 'field_one' => 's1.1.m2.f2', 'field_two' => 's1.1.m2.f2')));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = Set::pushDiff($array1, null);
|
$result = Set::pushDiff($array1, null);
|
||||||
|
|
|
@ -867,7 +867,7 @@ class XmlTest extends CakeTestCase {
|
||||||
$this->assertEquals(str_replace(array("\r", "\n"), '', $obj->asXML()), $expected);
|
$this->assertEquals(str_replace(array("\r", "\n"), '', $obj->asXML()), $expected);
|
||||||
|
|
||||||
//multiple model results - without a records key it would fatal error
|
//multiple model results - without a records key it would fatal error
|
||||||
$data = $user->find('all', array('limit'=>2));
|
$data = $user->find('all', array('limit' => 2));
|
||||||
$data = array('records' => $data);
|
$data = array('records' => $data);
|
||||||
$obj = Xml::build(compact('data'));
|
$obj = Xml::build(compact('data'));
|
||||||
$expected = '<' . '?xml version="1.0" encoding="UTF-8"?><data>';
|
$expected = '<' . '?xml version="1.0" encoding="UTF-8"?><data>';
|
||||||
|
|
|
@ -1324,7 +1324,7 @@ class FormHelperTest extends CakeTestCase {
|
||||||
$this->assertEquals($this->Form->fields, array());
|
$this->assertEquals($this->Form->fields, array());
|
||||||
|
|
||||||
$result = $this->Form->file('Attachment.file');
|
$result = $this->Form->file('Attachment.file');
|
||||||
$expected = array (
|
$expected = array(
|
||||||
'Attachment.file.name', 'Attachment.file.type', 'Attachment.file.tmp_name',
|
'Attachment.file.name', 'Attachment.file.type', 'Attachment.file.tmp_name',
|
||||||
'Attachment.file.error', 'Attachment.file.size'
|
'Attachment.file.error', 'Attachment.file.size'
|
||||||
);
|
);
|
||||||
|
@ -2144,7 +2144,7 @@ class FormHelperTest extends CakeTestCase {
|
||||||
$this->assertRegExp('#<option value="15"[^>]*>15</option>#', $result[1]);
|
$this->assertRegExp('#<option value="15"[^>]*>15</option>#', $result[1]);
|
||||||
|
|
||||||
$result = $this->Form->input('prueba', array(
|
$result = $this->Form->input('prueba', array(
|
||||||
'type' => 'time', 'timeFormat'=> 24 , 'dateFormat'=>'DMY' , 'minYear' => 2008,
|
'type' => 'time', 'timeFormat' => 24 , 'dateFormat' => 'DMY' , 'minYear' => 2008,
|
||||||
'maxYear' => date('Y') + 1 ,'interval' => 15
|
'maxYear' => date('Y') + 1 ,'interval' => 15
|
||||||
));
|
));
|
||||||
$result = explode(':', $result);
|
$result = explode(':', $result);
|
||||||
|
@ -2170,8 +2170,8 @@ class FormHelperTest extends CakeTestCase {
|
||||||
function testInputDatetime() {
|
function testInputDatetime() {
|
||||||
extract($this->dateRegex);
|
extract($this->dateRegex);
|
||||||
$result = $this->Form->input('prueba', array(
|
$result = $this->Form->input('prueba', array(
|
||||||
'type' => 'datetime', 'timeFormat'=> 24 , 'dateFormat'=>'DMY' , 'minYear' => 2008,
|
'type' => 'datetime', 'timeFormat' => 24, 'dateFormat' => 'DMY', 'minYear' => 2008,
|
||||||
'maxYear' => date('Y') + 1 ,'interval' => 15
|
'maxYear' => date('Y') + 1, 'interval' => 15
|
||||||
));
|
));
|
||||||
$result = explode(':', $result);
|
$result = explode(':', $result);
|
||||||
$this->assertNotRegExp('#<option value="12"[^>]*>12</option>#', $result[1]);
|
$this->assertNotRegExp('#<option value="12"[^>]*>12</option>#', $result[1]);
|
||||||
|
@ -4337,7 +4337,7 @@ class FormHelperTest extends CakeTestCase {
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$this->Form->request->data['Contact']['published'] = 0;
|
$this->Form->request->data['Contact']['published'] = 0;
|
||||||
$result = $this->Form->checkbox('Contact.published', array('id'=>'theID'));
|
$result = $this->Form->checkbox('Contact.published', array('id' => 'theID'));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'input' => array('type' => 'hidden', 'name' => 'data[Contact][published]', 'value' => '0', 'id' => 'theID_'),
|
'input' => array('type' => 'hidden', 'name' => 'data[Contact][published]', 'value' => '0', 'id' => 'theID_'),
|
||||||
array('input' => array('type' => 'checkbox', 'name' => 'data[Contact][published]', 'value' => '1', 'id' => 'theID'))
|
array('input' => array('type' => 'checkbox', 'name' => 'data[Contact][published]', 'value' => '1', 'id' => 'theID'))
|
||||||
|
|
|
@ -446,11 +446,11 @@ class HtmlHelperTest extends CakeTestCase {
|
||||||
$result = $this->Html->style('display: none;');
|
$result = $this->Html->style('display: none;');
|
||||||
$this->assertEquals($result, 'display: none;');
|
$this->assertEquals($result, 'display: none;');
|
||||||
|
|
||||||
$result = $this->Html->style(array('display'=> 'none', 'margin'=>'10px'));
|
$result = $this->Html->style(array('display' => 'none', 'margin' => '10px'));
|
||||||
$expected = 'display:none; margin:10px;';
|
$expected = 'display:none; margin:10px;';
|
||||||
$this->assertRegExp('/^display\s*:\s*none\s*;\s*margin\s*:\s*10px\s*;?$/', $expected);
|
$this->assertRegExp('/^display\s*:\s*none\s*;\s*margin\s*:\s*10px\s*;?$/', $expected);
|
||||||
|
|
||||||
$result = $this->Html->style(array('display'=> 'none', 'margin'=>'10px'), false);
|
$result = $this->Html->style(array('display' => 'none', 'margin' => '10px'), false);
|
||||||
$lines = explode("\n", $result);
|
$lines = explode("\n", $result);
|
||||||
$this->assertRegExp('/^\s*display\s*:\s*none\s*;\s*$/', $lines[0]);
|
$this->assertRegExp('/^\s*display\s*:\s*none\s*;\s*$/', $lines[0]);
|
||||||
$this->assertRegExp('/^\s*margin\s*:\s*10px\s*;?$/', $lines[1]);
|
$this->assertRegExp('/^\s*margin\s*:\s*10px\s*;?$/', $lines[1]);
|
||||||
|
@ -1055,7 +1055,7 @@ class HtmlHelperTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$result = $this->Html->nestedList($list, array('class'=>'list'));
|
$result = $this->Html->nestedList($list, array('class' => 'list'));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
array('ul' => array('class' => 'list')),
|
array('ul' => array('class' => 'list')),
|
||||||
'<li', 'Item 1', '/li',
|
'<li', 'Item 1', '/li',
|
||||||
|
@ -1145,7 +1145,7 @@ class HtmlHelperTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$result = $this->Html->nestedList($list, array('class'=>'list'), array('class' => 'item'));
|
$result = $this->Html->nestedList($list, array('class' => 'list'), array('class' => 'item'));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
array('ul' => array('class' => 'list')),
|
array('ul' => array('class' => 'list')),
|
||||||
array('li' => array('class' => 'item')), 'Item 1', '/li',
|
array('li' => array('class' => 'item')), 'Item 1', '/li',
|
||||||
|
|
|
@ -112,11 +112,11 @@ class NumberHelperTest extends CakeTestCase {
|
||||||
$expected = '£100,100,100.00';
|
$expected = '£100,100,100.00';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $this->Number->currency($value, '', array('thousands' =>' ', 'wholeSymbol' => '€', 'wholePosition' => 'after', 'decimals' => ',', 'zero' => 'Gratuit'));
|
$result = $this->Number->currency($value, '', array('thousands' => ' ', 'wholeSymbol' => '€', 'wholePosition' => 'after', 'decimals' => ',', 'zero' => 'Gratuit'));
|
||||||
$expected = '100 100 100,00€';
|
$expected = '100 100 100,00€';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $this->Number->currency(1000.45, NULL, array('after'=>'øre','before'=>'Kr. ','decimals'=>',','thousands'=>'.'));
|
$result = $this->Number->currency(1000.45, NULL, array('after' => 'øre', 'before' => 'Kr. ', 'decimals' => ',', 'thousands' => '.'));
|
||||||
$expected = 'Kr. 1.000,45';
|
$expected = 'Kr. 1.000,45';
|
||||||
$this->assertEquals($expected,$result);
|
$this->assertEquals($expected,$result);
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ class NumberHelperTest extends CakeTestCase {
|
||||||
$expected = '50c';
|
$expected = '50c';
|
||||||
$this->assertEquals($expected,$result);
|
$this->assertEquals($expected,$result);
|
||||||
|
|
||||||
$result = $this->Number->currency(0.5, NULL, array('after'=>'øre'));
|
$result = $this->Number->currency(0.5, NULL, array('after' => 'øre'));
|
||||||
$expected = '50øre';
|
$expected = '50øre';
|
||||||
$this->assertEquals($expected,$result);
|
$this->assertEquals($expected,$result);
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ class NumberHelperTest extends CakeTestCase {
|
||||||
$expected = '$100,100,100.00';
|
$expected = '$100,100,100.00';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $this->Number->currency($value, 'USD', array('before'=> '#'));
|
$result = $this->Number->currency($value, 'USD', array('before' => '#'));
|
||||||
$expected = '#100,100,100.00';
|
$expected = '#100,100,100.00';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
@ -239,15 +239,15 @@ class NumberHelperTest extends CakeTestCase {
|
||||||
$expected = '(£100,100,100.00)';
|
$expected = '(£100,100,100.00)';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $this->Number->currency($value, 'USD', array('negative'=>'-'));
|
$result = $this->Number->currency($value, 'USD', array('negative' => '-'));
|
||||||
$expected = '-$100,100,100.00';
|
$expected = '-$100,100,100.00';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $this->Number->currency($value, 'EUR', array('negative'=>'-'));
|
$result = $this->Number->currency($value, 'EUR', array('negative' => '-'));
|
||||||
$expected = '-€100.100.100,00';
|
$expected = '-€100.100.100,00';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $this->Number->currency($value, 'GBP', array('negative'=>'-'));
|
$result = $this->Number->currency($value, 'GBP', array('negative' => '-'));
|
||||||
$expected = '-£100,100,100.00';
|
$expected = '-£100,100,100.00';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
@ -294,15 +294,15 @@ class NumberHelperTest extends CakeTestCase {
|
||||||
$expected = '(99p)';
|
$expected = '(99p)';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $this->Number->currency($value, 'USD', array('negative'=>'-'));
|
$result = $this->Number->currency($value, 'USD', array('negative' => '-'));
|
||||||
$expected = '-99c';
|
$expected = '-99c';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $this->Number->currency($value, 'EUR', array('negative'=>'-'));
|
$result = $this->Number->currency($value, 'EUR', array('negative' => '-'));
|
||||||
$expected = '-€0,99';
|
$expected = '-€0,99';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = $this->Number->currency($value, 'GBP', array('negative'=>'-'));
|
$result = $this->Number->currency($value, 'GBP', array('negative' => '-'));
|
||||||
$expected = '-99p';
|
$expected = '-99p';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2123,10 +2123,10 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
$this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc');
|
$this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc');
|
||||||
$this->Paginator->request->params['paging']['Article']['page'] = 1;
|
$this->Paginator->request->params['paging']['Article']['page'] = 1;
|
||||||
|
|
||||||
$test = array('url'=> array(
|
$test = array('url' => array(
|
||||||
'page'=> '1',
|
'page' => '1',
|
||||||
'sort'=>'Article.title',
|
'sort' => 'Article.title',
|
||||||
'direction'=>'asc',
|
'direction' => 'asc',
|
||||||
));
|
));
|
||||||
$this->Paginator->options($test);
|
$this->Paginator->options($test);
|
||||||
|
|
||||||
|
@ -2152,8 +2152,8 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
public function testAjaxLinkGenerationNumbers() {
|
public function testAjaxLinkGenerationNumbers() {
|
||||||
$this->Paginator->Js->expectCallCount('link', 2);
|
$this->Paginator->Js->expectCallCount('link', 2);
|
||||||
$result = $this->Paginator->numbers(array(
|
$result = $this->Paginator->numbers(array(
|
||||||
'modulus'=> '2',
|
'modulus' => '2',
|
||||||
'url'=> array('controller' => 'projects', 'action' => 'sort'),
|
'url' => array('controller' => 'projects', 'action' => 'sort'),
|
||||||
'update' => 'list'
|
'update' => 'list'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ class RssHelperTest extends CakeTestCase {
|
||||||
'cloud' => array(
|
'cloud' => array(
|
||||||
'domain' => "rpc.sys.com",
|
'domain' => "rpc.sys.com",
|
||||||
'port' => "80",
|
'port' => "80",
|
||||||
'path' =>"/RPC2",
|
'path' => "/RPC2",
|
||||||
'registerProcedure' => "myCloud.rssPleaseNotify",
|
'registerProcedure' => "myCloud.rssPleaseNotify",
|
||||||
'protocol' => "xml-rpc"
|
'protocol' => "xml-rpc"
|
||||||
)
|
)
|
||||||
|
@ -175,7 +175,7 @@ class RssHelperTest extends CakeTestCase {
|
||||||
'cloud' => array(
|
'cloud' => array(
|
||||||
'domain' => "rpc.sys.com",
|
'domain' => "rpc.sys.com",
|
||||||
'port' => "80",
|
'port' => "80",
|
||||||
'path' =>"/RPC2",
|
'path' => "/RPC2",
|
||||||
'registerProcedure' => "myCloud.rssPleaseNotify",
|
'registerProcedure' => "myCloud.rssPleaseNotify",
|
||||||
'protocol' => "xml-rpc"
|
'protocol' => "xml-rpc"
|
||||||
),
|
),
|
||||||
|
@ -219,7 +219,7 @@ class RssHelperTest extends CakeTestCase {
|
||||||
'xmlns:atom' => 'http://www.w3.org/2005/Atom',
|
'xmlns:atom' => 'http://www.w3.org/2005/Atom',
|
||||||
'href' => "http://www.example.com/rss.xml",
|
'href' => "http://www.example.com/rss.xml",
|
||||||
'rel' => "self",
|
'rel' => "self",
|
||||||
'type' =>"application/rss+xml"
|
'type' => "application/rss+xml"
|
||||||
),
|
),
|
||||||
'content-here',
|
'content-here',
|
||||||
'/channel',
|
'/channel',
|
||||||
|
|
|
@ -221,12 +221,12 @@ class TextHelperTest extends CakeTestCase {
|
||||||
|
|
||||||
$text = 'This is a test text with URL http://www.cakephp.org';
|
$text = 'This is a test text with URL http://www.cakephp.org';
|
||||||
$expected = 'This is a test text with URL <a href="http://www.cakephp.org" class="link">http://www.cakephp.org</a>';
|
$expected = 'This is a test text with URL <a href="http://www.cakephp.org" class="link">http://www.cakephp.org</a>';
|
||||||
$result = $this->Text->autoLink($text, array('class'=>'link'));
|
$result = $this->Text->autoLink($text, array('class' => 'link'));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$text = 'This is a test text with URL http://www.cakephp.org';
|
$text = 'This is a test text with URL http://www.cakephp.org';
|
||||||
$expected = 'This is a test text with URL <a href="http://www.cakephp.org" class="link" id="MyLink">http://www.cakephp.org</a>';
|
$expected = 'This is a test text with URL <a href="http://www.cakephp.org" class="link" id="MyLink">http://www.cakephp.org</a>';
|
||||||
$result = $this->Text->autoLink($text, array('class'=>'link', 'id'=>'MyLink'));
|
$result = $this->Text->autoLink($text, array('class' => 'link', 'id' => 'MyLink'));
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,16 +420,16 @@ class TextHelperTest extends CakeTestCase {
|
||||||
$result = $this->Text->toList(array('Dusty', 'Lucky', 'Ned'), 'y');
|
$result = $this->Text->toList(array('Dusty', 'Lucky', 'Ned'), 'y');
|
||||||
$this->assertEquals($result, 'Dusty, Lucky y Ned');
|
$this->assertEquals($result, 'Dusty, Lucky y Ned');
|
||||||
|
|
||||||
$result = $this->Text->toList(array( 1 => 'Dusty', 2 => 'Lucky', 3 => 'Ned'), 'y');
|
$result = $this->Text->toList(array(1 => 'Dusty', 2 => 'Lucky', 3 => 'Ned'), 'y');
|
||||||
$this->assertEquals($result, 'Dusty, Lucky y Ned');
|
$this->assertEquals($result, 'Dusty, Lucky y Ned');
|
||||||
|
|
||||||
$result = $this->Text->toList(array( 1 => 'Dusty', 2 => 'Lucky', 3 => 'Ned'), 'and', ' + ');
|
$result = $this->Text->toList(array(1 => 'Dusty', 2 => 'Lucky', 3 => 'Ned'), 'and', ' + ');
|
||||||
$this->assertEquals($result, 'Dusty + Lucky and Ned');
|
$this->assertEquals($result, 'Dusty + Lucky and Ned');
|
||||||
|
|
||||||
$result = $this->Text->toList(array( 'name1' => 'Dusty', 'name2' => 'Lucky'));
|
$result = $this->Text->toList(array('name1' => 'Dusty', 'name2' => 'Lucky'));
|
||||||
$this->assertEquals($result, 'Dusty and Lucky');
|
$this->assertEquals($result, 'Dusty and Lucky');
|
||||||
|
|
||||||
$result = $this->Text->toList(array( 'test_0' => 'banana', 'test_1' => 'apple', 'test_2' => 'lemon'));
|
$result = $this->Text->toList(array('test_0' => 'banana', 'test_1' => 'apple', 'test_2' => 'lemon'));
|
||||||
$this->assertEquals($result, 'banana, apple and lemon');
|
$this->assertEquals($result, 'banana, apple and lemon');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,8 +169,8 @@ class TimeHelperTest extends CakeTestCase {
|
||||||
$relative_date .= ($relative_date ? ', -' : '-') . $seconds . ' second' . ($seconds != 1 ? 's' : '');
|
$relative_date .= ($relative_date ? ', -' : '-') . $seconds . ' second' . ($seconds != 1 ? 's' : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (date('j/n/y', strtotime(str_replace(',','',$relative_date))) != '1/1/70') {
|
if (date('j/n/y', strtotime(str_replace(',', '', $relative_date))) != '1/1/70') {
|
||||||
$result = $this->Time->timeAgoInWords(strtotime(str_replace(',','',$relative_date)), array('end' => '8 years'), true);
|
$result = $this->Time->timeAgoInWords(strtotime(str_replace(',', '', $relative_date)), array('end' => '8 years'), true);
|
||||||
if ($relative_date == '0 seconds') {
|
if ($relative_date == '0 seconds') {
|
||||||
$relative_date = '0 seconds ago';
|
$relative_date = '0 seconds ago';
|
||||||
}
|
}
|
||||||
|
@ -223,8 +223,8 @@ class TimeHelperTest extends CakeTestCase {
|
||||||
$relative_date .= ($relative_date ? ', ' : '') . $seconds . ' second' . ($seconds != 1 ? 's' : '');
|
$relative_date .= ($relative_date ? ', ' : '') . $seconds . ' second' . ($seconds != 1 ? 's' : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (date('j/n/y', strtotime(str_replace(',','',$relative_date))) != '1/1/70') {
|
if (date('j/n/y', strtotime(str_replace(',', '', $relative_date))) != '1/1/70') {
|
||||||
$result = $this->Time->timeAgoInWords(strtotime(str_replace(',','',$relative_date)), array('end' => '8 years'), true);
|
$result = $this->Time->timeAgoInWords(strtotime(str_replace(',', '', $relative_date)), array('end' => '8 years'), true);
|
||||||
if ($relative_date == '0 seconds') {
|
if ($relative_date == '0 seconds') {
|
||||||
$relative_date = '0 seconds ago';
|
$relative_date = '0 seconds ago';
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ class HelperTestPost extends Model {
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $hasAndBelongsToMany = array('HelperTestTag'=> array('with' => 'HelperTestPostsTag'));
|
public $hasAndBelongsToMany = array('HelperTestTag' => array('with' => 'HelperTestPostsTag'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -218,7 +218,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
||||||
'pass' => array(),
|
'pass' => array(),
|
||||||
'form' => array(),
|
'form' => array(),
|
||||||
'named' => array(),
|
'named' => array(),
|
||||||
'url' => array('url' =>'scaffold_mock'),
|
'url' => array('url' => 'scaffold_mock'),
|
||||||
'controller' => 'scaffold_mock',
|
'controller' => 'scaffold_mock',
|
||||||
'action' => 'index',
|
'action' => 'index',
|
||||||
);
|
);
|
||||||
|
@ -303,7 +303,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
||||||
'pass' => array(1),
|
'pass' => array(1),
|
||||||
'form' => array(),
|
'form' => array(),
|
||||||
'named' => array(),
|
'named' => array(),
|
||||||
'url' => array('url' =>'scaffold_mock'),
|
'url' => array('url' => 'scaffold_mock'),
|
||||||
'controller' => 'scaffold_mock',
|
'controller' => 'scaffold_mock',
|
||||||
'action' => 'edit',
|
'action' => 'edit',
|
||||||
);
|
);
|
||||||
|
@ -345,7 +345,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
||||||
'form' => array(),
|
'form' => array(),
|
||||||
'named' => array(),
|
'named' => array(),
|
||||||
'prefix' => 'admin',
|
'prefix' => 'admin',
|
||||||
'url' => array('url' =>'admin/scaffold_mock'),
|
'url' => array('url' => 'admin/scaffold_mock'),
|
||||||
'controller' => 'scaffold_mock',
|
'controller' => 'scaffold_mock',
|
||||||
'action' => 'admin_index',
|
'action' => 'admin_index',
|
||||||
'admin' => 1,
|
'admin' => 1,
|
||||||
|
@ -388,7 +388,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
||||||
'form' => array(),
|
'form' => array(),
|
||||||
'named' => array(),
|
'named' => array(),
|
||||||
'prefix' => 'admin',
|
'prefix' => 'admin',
|
||||||
'url' => array('url' =>'admin/scaffold_mock/edit/1'),
|
'url' => array('url' => 'admin/scaffold_mock/edit/1'),
|
||||||
'controller' => 'scaffold_mock',
|
'controller' => 'scaffold_mock',
|
||||||
'action' => 'admin_edit',
|
'action' => 'admin_edit',
|
||||||
'admin' => 1,
|
'admin' => 1,
|
||||||
|
@ -429,7 +429,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
||||||
'form' => array(),
|
'form' => array(),
|
||||||
'named' => array(),
|
'named' => array(),
|
||||||
'prefix' => 'member',
|
'prefix' => 'member',
|
||||||
'url' => array('url' =>'member/scaffold_mock'),
|
'url' => array('url' => 'member/scaffold_mock'),
|
||||||
'controller' => 'scaffold_mock',
|
'controller' => 'scaffold_mock',
|
||||||
'action' => 'member_index',
|
'action' => 'member_index',
|
||||||
'member' => 1,
|
'member' => 1,
|
||||||
|
|
|
@ -57,7 +57,7 @@ class AcoFixture extends CakeTestFixture {
|
||||||
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 3, 'rght' => 6),
|
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 3, 'rght' => 6),
|
||||||
array('parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 4, 'rght' => 5),
|
array('parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 4, 'rght' => 5),
|
||||||
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action2', 'lft' => 7, 'rght' => 8),
|
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action2', 'lft' => 7, 'rght' => 8),
|
||||||
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Controller2','lft' => 10, 'rght' => 17),
|
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Controller2', 'lft' => 10, 'rght' => 17),
|
||||||
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 11, 'rght' => 14),
|
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 11, 'rght' => 14),
|
||||||
array('parent_id' => 7, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 12, 'rght' => 13),
|
array('parent_id' => 7, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 12, 'rght' => 13),
|
||||||
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'action2', 'lft' => 15, 'rght' => 16),
|
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'action2', 'lft' => 15, 'rght' => 16),
|
||||||
|
|
|
@ -53,7 +53,7 @@ class AcoTwoFixture extends CakeTestFixture {
|
||||||
*/
|
*/
|
||||||
public $records = array(
|
public $records = array(
|
||||||
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 20),
|
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 20),
|
||||||
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'tpsReports', 'lft' => 2, 'rght' => 9),
|
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'tpsReports','lft' => 2, 'rght' => 9),
|
||||||
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'view', 'lft' => 3, 'rght' => 6),
|
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'view', 'lft' => 3, 'rght' => 6),
|
||||||
array('parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'current', 'lft' => 4, 'rght' => 5),
|
array('parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'current', 'lft' => 4, 'rght' => 5),
|
||||||
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'update', 'lft' => 7, 'rght' => 8),
|
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'update', 'lft' => 7, 'rght' => 8),
|
||||||
|
|
|
@ -52,15 +52,15 @@ class AroTwoFixture extends CakeTestFixture {
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $records = array(
|
public $records = array(
|
||||||
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'root', 'lft' => '1', 'rght' => '20'),
|
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'root', 'lft' => '1', 'rght' => '20'),
|
||||||
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '1', 'alias' => 'admin', 'lft' => '2', 'rght' => '5'),
|
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '1', 'alias' => 'admin', 'lft' => '2', 'rght' => '5'),
|
||||||
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '2', 'alias' => 'managers', 'lft' => '6', 'rght' => '9'),
|
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '2', 'alias' => 'managers', 'lft' => '6', 'rght' => '9'),
|
||||||
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '3', 'alias' => 'users', 'lft' => '10', 'rght' => '19'),
|
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '3', 'alias' => 'users', 'lft' => '10', 'rght' => '19'),
|
||||||
array('parent_id' => 2, 'model' => 'User', 'foreign_key' => '1', 'alias' => 'Bobs', 'lft' => '3', 'rght' => '4' ),
|
array('parent_id' => 2, 'model' => 'User', 'foreign_key' => '1', 'alias' => 'Bobs', 'lft' => '3', 'rght' => '4'),
|
||||||
array('parent_id' => 3, 'model' => 'User', 'foreign_key' => '2', 'alias' => 'Lumbergh', 'lft' => '7' , 'rght' => '8'),
|
array('parent_id' => 3, 'model' => 'User', 'foreign_key' => '2', 'alias' => 'Lumbergh', 'lft' => '7' , 'rght' => '8'),
|
||||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '3', 'alias' => 'Samir', 'lft' => '11' , 'rght' => '12'),
|
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '3', 'alias' => 'Samir', 'lft' => '11' , 'rght' => '12'),
|
||||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '4', 'alias' => 'Micheal', 'lft' => '13', 'rght' => '14'),
|
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '4', 'alias' => 'Micheal', 'lft' => '13', 'rght' => '14'),
|
||||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '5', 'alias' => 'Peter', 'lft' => '15', 'rght' => '16'),
|
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '5', 'alias' => 'Peter', 'lft' => '15', 'rght' => '16'),
|
||||||
array( 'parent_id' => 4, 'model' => 'User', 'foreign_key' => '6', 'alias' => 'Milton', 'lft' => '17', 'rght' => '18'),
|
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '6', 'alias' => 'Milton', 'lft' => '17', 'rght' => '18'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,6 @@ class ArticleFeaturedsTagsFixture extends CakeTestFixture {
|
||||||
public $fields = array(
|
public $fields = array(
|
||||||
'article_featured_id' => array('type' => 'integer', 'null' => false),
|
'article_featured_id' => array('type' => 'integer', 'null' => false),
|
||||||
'tag_id' => array('type' => 'integer', 'null' => false),
|
'tag_id' => array('type' => 'integer', 'null' => false),
|
||||||
'indexes' => array('UNIQUE_FEATURED' => array('column'=> array('article_featured_id', 'tag_id'), 'unique'=> 1))
|
'indexes' => array('UNIQUE_FEATURED' => array('column' => array('article_featured_id', 'tag_id'), 'unique' => 1))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ class ArticlesTagFixture extends CakeTestFixture {
|
||||||
public $fields = array(
|
public $fields = array(
|
||||||
'article_id' => array('type' => 'integer', 'null' => false),
|
'article_id' => array('type' => 'integer', 'null' => false),
|
||||||
'tag_id' => array('type' => 'integer', 'null' => false),
|
'tag_id' => array('type' => 'integer', 'null' => false),
|
||||||
'indexes' => array('UNIQUE_TAG2' => array('column'=> array('article_id', 'tag_id'), 'unique'=>1))
|
'indexes' => array('UNIQUE_TAG2' => array('column' => array('article_id', 'tag_id'), 'unique' => 1))
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -39,7 +39,7 @@ class BakeArticlesBakeTagFixture extends CakeTestFixture {
|
||||||
public $fields = array(
|
public $fields = array(
|
||||||
'bake_article_id' => array('type' => 'integer', 'null' => false),
|
'bake_article_id' => array('type' => 'integer', 'null' => false),
|
||||||
'bake_tag_id' => array('type' => 'integer', 'null' => false),
|
'bake_tag_id' => array('type' => 'integer', 'null' => false),
|
||||||
'indexes' => array('UNIQUE_TAG' => array('column'=> array('bake_article_id', 'bake_tag_id'), 'unique'=>1))
|
'indexes' => array('UNIQUE_TAG' => array('column' => array('bake_article_id', 'bake_tag_id'), 'unique' => 1))
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -38,8 +38,8 @@ class BakeCommentFixture extends CakeTestFixture {
|
||||||
*/
|
*/
|
||||||
public $fields = array(
|
public $fields = array(
|
||||||
'otherid' => array('type' => 'integer', 'key' => 'primary'),
|
'otherid' => array('type' => 'integer', 'key' => 'primary'),
|
||||||
'bake_article_id' => array('type' => 'integer', 'null'=>false),
|
'bake_article_id' => array('type' => 'integer', 'null' => false),
|
||||||
'bake_user_id' => array('type' => 'integer', 'null'=>false),
|
'bake_user_id' => array('type' => 'integer', 'null' => false),
|
||||||
'comment' => 'text',
|
'comment' => 'text',
|
||||||
'published' => array('type' => 'string', 'length' => 1, 'default' => 'N'),
|
'published' => array('type' => 'string', 'length' => 1, 'default' => 'N'),
|
||||||
'created' => 'datetime',
|
'created' => 'datetime',
|
||||||
|
|
|
@ -38,8 +38,8 @@ class CommentFixture extends CakeTestFixture {
|
||||||
*/
|
*/
|
||||||
public $fields = array(
|
public $fields = array(
|
||||||
'id' => array('type' => 'integer', 'key' => 'primary'),
|
'id' => array('type' => 'integer', 'key' => 'primary'),
|
||||||
'article_id' => array('type' => 'integer', 'null'=>false),
|
'article_id' => array('type' => 'integer', 'null' => false),
|
||||||
'user_id' => array('type' => 'integer', 'null'=>false),
|
'user_id' => array('type' => 'integer', 'null' => false),
|
||||||
'comment' => 'text',
|
'comment' => 'text',
|
||||||
'published' => array('type' => 'string', 'length' => 1, 'default' => 'N'),
|
'published' => array('type' => 'string', 'length' => 1, 'default' => 'N'),
|
||||||
'created' => 'datetime',
|
'created' => 'datetime',
|
||||||
|
|
|
@ -33,7 +33,7 @@ class CounterCacheUserNonstandardPrimaryKeyFixture extends CakeTestFixture {
|
||||||
);
|
);
|
||||||
|
|
||||||
public $records = array(
|
public $records = array(
|
||||||
array('uid' => 66, 'name' => 'Alexander','post_count' => 2),
|
array('uid' => 66, 'name' => 'Alexander', 'post_count' => 2),
|
||||||
array('uid' => 301, 'name' => 'Steven','post_count' => 1),
|
array('uid' => 301, 'name' => 'Steven', 'post_count' => 1),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ class DatatypeFixture extends CakeTestFixture {
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $fields = array(
|
public $fields = array(
|
||||||
'id' => array('type' => 'integer', 'null'=> false, 'default'=> 0, 'key' => 'primary'),
|
'id' => array('type' => 'integer', 'null' => false, 'default' => 0, 'key' => 'primary'),
|
||||||
'float_field' => array('type' => 'float', 'length' => '5,2', 'null' => false, 'default' => null),
|
'float_field' => array('type' => 'float', 'length' => '5,2', 'null' => false, 'default' => null),
|
||||||
'bool' => array('type' => 'boolean', 'null' => false, 'default' => false),
|
'bool' => array('type' => 'boolean', 'null' => false, 'default' => false),
|
||||||
);
|
);
|
||||||
|
|
|
@ -27,9 +27,9 @@ class GroupUpdateAllFixture extends CakeTestFixture {
|
||||||
public $table = 'group_update_all';
|
public $table = 'group_update_all';
|
||||||
|
|
||||||
public $fields = array(
|
public $fields = array(
|
||||||
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
|
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
|
||||||
'name' => array('type'=>'string', 'null' => false, 'length' => 29),
|
'name' => array('type' => 'string', 'null' => false, 'length' => 29),
|
||||||
'code' => array('type'=>'integer', 'null' => false, 'length' => 4),
|
'code' => array('type' => 'integer', 'null' => false, 'length' => 4),
|
||||||
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
|
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
|
||||||
);
|
);
|
||||||
public $records = array(
|
public $records = array(
|
||||||
|
|
|
@ -27,33 +27,33 @@ class ProductUpdateAllFixture extends CakeTestFixture {
|
||||||
public $table = 'product_update_all';
|
public $table = 'product_update_all';
|
||||||
|
|
||||||
public $fields = array(
|
public $fields = array(
|
||||||
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
|
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
|
||||||
'name' => array('type'=>'string', 'null' => false, 'length' => 29),
|
'name' => array('type' => 'string', 'null' => false, 'length' => 29),
|
||||||
'groupcode' => array('type'=>'integer', 'null' => false, 'length' => 4),
|
'groupcode' => array('type' => 'integer', 'null' => false, 'length' => 4),
|
||||||
'group_id' => array('type'=>'integer', 'null' => false, 'length' => 8),
|
'group_id' => array('type' => 'integer', 'null' => false, 'length' => 8),
|
||||||
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
|
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
|
||||||
);
|
);
|
||||||
public $records = array(
|
public $records = array(
|
||||||
array(
|
array(
|
||||||
'id' => 1,
|
'id' => 1,
|
||||||
'name' => 'product one',
|
'name' => 'product one',
|
||||||
'groupcode' => 120,
|
'groupcode' => 120,
|
||||||
'group_id' => 1
|
'group_id' => 1
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'id' => 2,
|
'id' => 2,
|
||||||
'name' => 'product two',
|
'name' => 'product two',
|
||||||
'groupcode' => 120,
|
'groupcode' => 120,
|
||||||
'group_id' => 1),
|
'group_id' => 1),
|
||||||
array(
|
array(
|
||||||
'id' => 3,
|
'id' => 3,
|
||||||
'name' => 'product three',
|
'name' => 'product three',
|
||||||
'groupcode' => 125,
|
'groupcode' => 125,
|
||||||
'group_id' => 2),
|
'group_id' => 2),
|
||||||
array(
|
array(
|
||||||
'id' => 4,
|
'id' => 4,
|
||||||
'name' => 'product four',
|
'name' => 'product four',
|
||||||
'groupcode' => 135,
|
'groupcode' => 135,
|
||||||
'group_id' => 4)
|
'group_id' => 4)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ class StoriesTagFixture extends CakeTestFixture {
|
||||||
public $fields = array(
|
public $fields = array(
|
||||||
'story' => array('type' => 'integer', 'null' => false),
|
'story' => array('type' => 'integer', 'null' => false),
|
||||||
'tag_id' => array('type' => 'integer', 'null' => false),
|
'tag_id' => array('type' => 'integer', 'null' => false),
|
||||||
'indexes' => array('UNIQUE_STORY_TAG' => array('column'=> array('story', 'tag_id'), 'unique'=>1))
|
'indexes' => array('UNIQUE_STORY_TAG' => array('column' => array('story', 'tag_id'), 'unique' => 1))
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -38,8 +38,8 @@ class TestPluginCommentFixture extends CakeTestFixture {
|
||||||
*/
|
*/
|
||||||
public $fields = array(
|
public $fields = array(
|
||||||
'id' => array('type' => 'integer', 'key' => 'primary'),
|
'id' => array('type' => 'integer', 'key' => 'primary'),
|
||||||
'article_id' => array('type' => 'integer', 'null'=>false),
|
'article_id' => array('type' => 'integer', 'null' => false),
|
||||||
'user_id' => array('type' => 'integer', 'null'=>false),
|
'user_id' => array('type' => 'integer', 'null' => false),
|
||||||
'comment' => 'text',
|
'comment' => 'text',
|
||||||
'published' => array('type' => 'string', 'length' => 1, 'default' => 'N'),
|
'published' => array('type' => 'string', 'length' => 1, 'default' => 'N'),
|
||||||
'created' => 'datetime',
|
'created' => 'datetime',
|
||||||
|
|
|
@ -23,13 +23,13 @@ class TestPluginAppSchema extends CakeSchema {
|
||||||
public $name = 'TestPluginApp';
|
public $name = 'TestPluginApp';
|
||||||
|
|
||||||
public $test_plugin_acos = array(
|
public $test_plugin_acos = array(
|
||||||
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
|
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
|
||||||
'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
||||||
'model' => array('type'=>'string', 'null' => true),
|
'model' => array('type' => 'string', 'null' => true),
|
||||||
'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
||||||
'alias' => array('type'=>'string', 'null' => true),
|
'alias' => array('type' => 'string', 'null' => true),
|
||||||
'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
'lft' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
||||||
'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
'rght' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
|
||||||
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
|
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework
|
||||||
</div>
|
</div>
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<?php echo $this->Html->link(
|
<?php echo $this->Html->link(
|
||||||
$this->Html->image('cake.power.gif', array('alt'=> $cakeDescription, 'border' => '0')),
|
$this->Html->image('cake.power.gif', array('alt' => $cakeDescription, 'border' => '0')),
|
||||||
'http://www.cakephp.org/',
|
'http://www.cakephp.org/',
|
||||||
array('target' => '_blank', 'escape' => false)
|
array('target' => '_blank', 'escape' => false)
|
||||||
);
|
);
|
||||||
|
|
|
@ -656,7 +656,7 @@ class Folder {
|
||||||
chmod($to, $mode);
|
chmod($to, $mode);
|
||||||
umask($old);
|
umask($old);
|
||||||
$this->_messages[] = __d('cake_dev', '%s created', $to);
|
$this->_messages[] = __d('cake_dev', '%s created', $to);
|
||||||
$options = array_merge($options, array('to'=> $to, 'from'=> $from));
|
$options = array_merge($options, array('to' => $to, 'from' => $from));
|
||||||
$this->copy($options);
|
$this->copy($options);
|
||||||
} else {
|
} else {
|
||||||
$this->_errors[] = __d('cake_dev', '%s not created', $to);
|
$this->_errors[] = __d('cake_dev', '%s not created', $to);
|
||||||
|
|
|
@ -220,7 +220,7 @@ class Inflector {
|
||||||
'/Ź|Ż|Ž/' => 'Z',
|
'/Ź|Ż|Ž/' => 'Z',
|
||||||
'/ź|ż|ž/' => 'z',
|
'/ź|ż|ž/' => 'z',
|
||||||
'/Æ|Ǽ/' => 'AE',
|
'/Æ|Ǽ/' => 'AE',
|
||||||
'/ß/'=> 'ss',
|
'/ß/' => 'ss',
|
||||||
'/IJ/' => 'IJ',
|
'/IJ/' => 'IJ',
|
||||||
'/ij/' => 'ij',
|
'/ij/' => 'ij',
|
||||||
'/Œ/' => 'OE',
|
'/Œ/' => 'OE',
|
||||||
|
|
|
@ -626,7 +626,7 @@ class Set {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $tmp;
|
return $tmp;
|
||||||
} elseif (false !== strpos($key,'{') && false !== strpos($key,'}')) {
|
} elseif (false !== strpos($key, '{') && false !== strpos($key, '}')) {
|
||||||
$pattern = substr($key, 1, -1);
|
$pattern = substr($key, 1, -1);
|
||||||
|
|
||||||
foreach ($data as $j => $val) {
|
foreach ($data as $j => $val) {
|
||||||
|
|
|
@ -65,7 +65,7 @@ class Helper extends Object {
|
||||||
public $plugin = null;
|
public $plugin = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the fields array('field_name' => array('type'=> 'string', 'length'=> 100),
|
* Holds the fields array('field_name' => array('type' => 'string', 'length' => 100),
|
||||||
* primaryKey and validates array('field_name')
|
* primaryKey and validates array('field_name')
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
|
@ -811,7 +811,7 @@ class Helper extends Object {
|
||||||
$this->_cleaned = preg_replace('#(<[^>]+[\x00-\x20\"\'\/])(on|xmlns)[^>]*>#iUu', "$1>", $this->_cleaned);
|
$this->_cleaned = preg_replace('#(<[^>]+[\x00-\x20\"\'\/])(on|xmlns)[^>]*>#iUu', "$1>", $this->_cleaned);
|
||||||
$this->_cleaned = preg_replace('#([a-z]*)[\x00-\x20]*=[\x00-\x20]*([\`\'\"]*)[\\x00-\x20]*j[\x00-\x20]*a[\x00-\x20]*v[\x00-\x20]*a[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iUu', '$1=$2nojavascript...', $this->_cleaned);
|
$this->_cleaned = preg_replace('#([a-z]*)[\x00-\x20]*=[\x00-\x20]*([\`\'\"]*)[\\x00-\x20]*j[\x00-\x20]*a[\x00-\x20]*v[\x00-\x20]*a[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iUu', '$1=$2nojavascript...', $this->_cleaned);
|
||||||
$this->_cleaned = preg_replace('#([a-z]*)[\x00-\x20]*=([\'\"]*)[\x00-\x20]*v[\x00-\x20]*b[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iUu', '$1=$2novbscript...', $this->_cleaned);
|
$this->_cleaned = preg_replace('#([a-z]*)[\x00-\x20]*=([\'\"]*)[\x00-\x20]*v[\x00-\x20]*b[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iUu', '$1=$2novbscript...', $this->_cleaned);
|
||||||
$this->_cleaned = preg_replace('#([a-z]*)[\x00-\x20]*=*([\'\"]*)[\x00-\x20]*-moz-binding[\x00-\x20]*:#iUu','$1=$2nomozbinding...', $this->_cleaned);
|
$this->_cleaned = preg_replace('#([a-z]*)[\x00-\x20]*=*([\'\"]*)[\x00-\x20]*-moz-binding[\x00-\x20]*:#iUu', '$1=$2nomozbinding...', $this->_cleaned);
|
||||||
$this->_cleaned = preg_replace('#([a-z]*)[\x00-\x20]*=([\'\"]*)[\x00-\x20]*data[\x00-\x20]*:#Uu', '$1=$2nodata...', $this->_cleaned);
|
$this->_cleaned = preg_replace('#([a-z]*)[\x00-\x20]*=([\'\"]*)[\x00-\x20]*data[\x00-\x20]*:#Uu', '$1=$2nodata...', $this->_cleaned);
|
||||||
$this->_cleaned = preg_replace('#(<[^>]+)style[\x00-\x20]*=[\x00-\x20]*([\`\'\"]*).*expression[\x00-\x20]*\([^>]*>#iU', "$1>", $this->_cleaned);
|
$this->_cleaned = preg_replace('#(<[^>]+)style[\x00-\x20]*=[\x00-\x20]*([\`\'\"]*).*expression[\x00-\x20]*\([^>]*>#iU', "$1>", $this->_cleaned);
|
||||||
$this->_cleaned = preg_replace('#(<[^>]+)style[\x00-\x20]*=[\x00-\x20]*([\`\'\"]*).*behaviour[\x00-\x20]*\([^>]*>#iU', "$1>", $this->_cleaned);
|
$this->_cleaned = preg_replace('#(<[^>]+)style[\x00-\x20]*=[\x00-\x20]*([\`\'\"]*).*behaviour[\x00-\x20]*\([^>]*>#iU', "$1>", $this->_cleaned);
|
||||||
|
|
|
@ -181,7 +181,7 @@ class HtmlHelper extends AppHelper {
|
||||||
*
|
*
|
||||||
* @param string $name Text for link
|
* @param string $name Text for link
|
||||||
* @param string $link URL for link (if empty it won't be a link)
|
* @param string $link URL for link (if empty it won't be a link)
|
||||||
* @param mixed $options Link attributes e.g. array('id'=>'selected')
|
* @param mixed $options Link attributes e.g. array('id' => 'selected')
|
||||||
* @return void
|
* @return void
|
||||||
* @see HtmlHelper::link() for details on $options that can be used.
|
* @see HtmlHelper::link() for details on $options that can be used.
|
||||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#creating-breadcrumb-trails-with-htmlhelper
|
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#creating-breadcrumb-trails-with-htmlhelper
|
||||||
|
|
|
@ -43,11 +43,11 @@ class NumberHelper extends AppHelper {
|
||||||
'zero' => 0, 'places' => 2, 'thousands' => ',', 'decimals' => '.', 'negative' => '()', 'escape' => true
|
'zero' => 0, 'places' => 2, 'thousands' => ',', 'decimals' => '.', 'negative' => '()', 'escape' => true
|
||||||
),
|
),
|
||||||
'GBP' => array(
|
'GBP' => array(
|
||||||
'wholeSymbol'=>'£', 'wholePosition' => 'before', 'fractionSymbol' => 'p', 'fractionPosition' => 'after',
|
'wholeSymbol' => '£', 'wholePosition' => 'before', 'fractionSymbol' => 'p', 'fractionPosition' => 'after',
|
||||||
'zero' => 0, 'places' => 2, 'thousands' => ',', 'decimals' => '.', 'negative' => '()','escape' => false
|
'zero' => 0, 'places' => 2, 'thousands' => ',', 'decimals' => '.', 'negative' => '()','escape' => false
|
||||||
),
|
),
|
||||||
'EUR' => array(
|
'EUR' => array(
|
||||||
'wholeSymbol'=>'€', 'wholePosition' => 'before', 'fractionSymbol' => false, 'fractionPosition' => 'after',
|
'wholeSymbol' => '€', 'wholePosition' => 'before', 'fractionSymbol' => false, 'fractionPosition' => 'after',
|
||||||
'zero' => 0, 'places' => 2, 'thousands' => '.', 'decimals' => ',', 'negative' => '()', 'escape' => false
|
'zero' => 0, 'places' => 2, 'thousands' => '.', 'decimals' => ',', 'negative' => '()', 'escape' => false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -58,7 +58,7 @@ class NumberHelper extends AppHelper {
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $_currencyDefaults = array(
|
protected $_currencyDefaults = array(
|
||||||
'wholeSymbol'=>'', 'wholePosition' => 'before', 'fractionSymbol' => '', 'fractionPosition' => 'after',
|
'wholeSymbol' => '', 'wholePosition' => 'before', 'fractionSymbol' => '', 'fractionPosition' => 'after',
|
||||||
'zero' => '0', 'places' => 2, 'thousands' => ',', 'decimals' => '.','negative' => '()', 'escape' => true
|
'zero' => '0', 'places' => 2, 'thousands' => ',', 'decimals' => '.','negative' => '()', 'escape' => true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ class NumberHelper extends AppHelper {
|
||||||
|
|
||||||
$escape = true;
|
$escape = true;
|
||||||
if (is_array($options)) {
|
if (is_array($options)) {
|
||||||
$options = array_merge(array('before'=>'$', 'places' => 2, 'thousands' => ',', 'decimals' => '.'), $options);
|
$options = array_merge(array('before' => '$', 'places' => 2, 'thousands' => ',', 'decimals' => '.'), $options);
|
||||||
extract($options);
|
extract($options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -660,7 +660,7 @@ class PaginatorHelper extends AppHelper {
|
||||||
);
|
);
|
||||||
$options += $defaults;
|
$options += $defaults;
|
||||||
|
|
||||||
$params = (array)$this->params($options['model']) + array('page'=> 1);
|
$params = (array)$this->params($options['model']) + array('page' => 1);
|
||||||
unset($options['model']);
|
unset($options['model']);
|
||||||
|
|
||||||
if ($params['pageCount'] <= 1) {
|
if ($params['pageCount'] <= 1) {
|
||||||
|
@ -854,7 +854,7 @@ class PaginatorHelper extends AppHelper {
|
||||||
$options = array_merge(
|
$options = array_merge(
|
||||||
array(
|
array(
|
||||||
'tag' => 'span',
|
'tag' => 'span',
|
||||||
'before'=> null,
|
'before' => null,
|
||||||
'model' => $this->defaultModel(),
|
'model' => $this->defaultModel(),
|
||||||
'separator' => ' | ',
|
'separator' => ' | ',
|
||||||
'ellipsis' => '...',
|
'ellipsis' => '...',
|
||||||
|
@ -862,7 +862,7 @@ class PaginatorHelper extends AppHelper {
|
||||||
),
|
),
|
||||||
(array)$options);
|
(array)$options);
|
||||||
|
|
||||||
$params = array_merge(array('page'=> 1), (array)$this->params($options['model']));
|
$params = array_merge(array('page' => 1), (array)$this->params($options['model']));
|
||||||
unset($options['model']);
|
unset($options['model']);
|
||||||
|
|
||||||
if ($params['pageCount'] <= 1) {
|
if ($params['pageCount'] <= 1) {
|
||||||
|
|
|
@ -48,7 +48,7 @@ $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework
|
||||||
</div>
|
</div>
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<?php echo $this->Html->link(
|
<?php echo $this->Html->link(
|
||||||
$this->Html->image('cake.power.gif', array('alt'=> $cakeDescription, 'border' => '0')),
|
$this->Html->image('cake.power.gif', array('alt' => $cakeDescription, 'border' => '0')),
|
||||||
'http://www.cakephp.org/',
|
'http://www.cakephp.org/',
|
||||||
array('target' => '_blank', 'escape' => false)
|
array('target' => '_blank', 'escape' => false)
|
||||||
);
|
);
|
||||||
|
|
|
@ -40,8 +40,8 @@
|
||||||
foreach ($associations as $_type => $_data) {
|
foreach ($associations as $_type => $_data) {
|
||||||
foreach ($_data as $_alias => $_details) {
|
foreach ($_data as $_alias => $_details) {
|
||||||
if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
|
if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
|
||||||
echo "\t\t<li>" . $this->Html->link(__d('cake', 'List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index')) . "</li>\n";
|
echo "\t\t<li>" . $this->Html->link(__d('cake', 'List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>\n";
|
||||||
echo "\t\t<li>" . $this->Html->link(__d('cake', 'New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "</li>\n";
|
echo "\t\t<li>" . $this->Html->link(__d('cake', 'New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n";
|
||||||
$done[] = $_details['controller'];
|
$done[] = $_details['controller'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue