Merge branch '2.0' of github.com:cakephp/cakephp into 2.0

This commit is contained in:
Ceeram 2011-12-01 20:30:45 +01:00
commit faddfbe2d0
87 changed files with 489 additions and 481 deletions

View file

@ -387,7 +387,7 @@ class Cache {
$settings = self::settings($config);
if (empty($settings)) {
return null;
return false;
}
if (!self::isInitialized($config)) {
return false;
@ -505,7 +505,7 @@ abstract class CacheEngine {
*/
public function init($settings = array()) {
$this->settings = array_merge(
array('prefix' => 'cake_', 'duration'=> 3600, 'probability'=> 100),
array('prefix' => 'cake_', 'duration' => 3600, 'probability' => 100),
$this->settings,
$settings
);

View file

@ -66,8 +66,8 @@ class FileEngine extends CacheEngine {
public function init($settings = array()) {
parent::init(array_merge(
array(
'engine' => 'File', 'path' => CACHE, 'prefix'=> 'cake_', 'lock'=> true,
'serialize'=> true, 'isWindows' => false, 'mask' => 0664
'engine' => 'File', 'path' => CACHE, 'prefix' => 'cake_', 'lock' => true,
'serialize' => true, 'isWindows' => false, 'mask' => 0664
),
$settings
));

View file

@ -59,10 +59,10 @@ class MemcacheEngine extends CacheEngine {
return false;
}
parent::init(array_merge(array(
'engine'=> 'Memcache',
'engine' => 'Memcache',
'prefix' => Inflector::slug(APP_DIR) . '_',
'servers' => array('127.0.0.1'),
'compress'=> false,
'compress' => false,
'persistent' => true
), $settings)
);

View file

@ -117,7 +117,7 @@ class ConsoleShell extends AppShell {
$out .= "\n";
$out .= "will return something like the following:";
$out .= "\n";
$out .= "\tarray (";
$out .= "\tarray(";
$out .= "\t [...]";
$out .= "\t 'controller' => 'posts',";
$out .= "\t 'action' => 'view',";

View file

@ -39,14 +39,14 @@ class DbConfigTask extends AppShell {
*/
protected $_defaultConfig = array(
'name' => 'default',
'datasource'=> 'Database/Mysql',
'persistent'=> 'false',
'host'=> 'localhost',
'login'=> 'root',
'password'=> 'password',
'database'=> 'project_name',
'schema'=> null,
'prefix'=> null,
'datasource' => 'Database/Mysql',
'persistent' => 'false',
'host' => 'localhost',
'login' => 'root',
'password' => 'password',
'database' => 'project_name',
'schema' => null,
'prefix' => null,
'encoding' => null,
'port' => null
);

View file

@ -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?");
$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') {
$validate = $this->doValidation($tempModel);
}
$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') {
$associations = $this->doAssociations($tempModel);
}
@ -258,7 +258,7 @@ class ModelTask extends BakeTask {
}
$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') {
$vars = compact('associations', 'validate', 'primaryKey', 'useTable', 'displayField');
@ -487,7 +487,7 @@ class ModelTask extends BakeTask {
}
$associations = array(
'belongsTo' => array(), 'hasMany' => array(), 'hasOne'=> array(), 'hasAndBelongsToMany' => array()
'belongsTo' => array(), 'hasMany' => array(), 'hasOne' => array(), 'hasAndBelongsToMany' => array()
);
$associations = $this->findBelongsTo($model, $associations);
@ -636,7 +636,7 @@ class ModelTask extends BakeTask {
if (!empty($associations[$type])) {
foreach ($associations[$type] as $i => $assoc) {
$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)) {
unset($associations[$type][$i]);
@ -659,7 +659,7 @@ class ModelTask extends BakeTask {
*/
public function doMoreAssociations($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();
while (strtolower($wannaDoMoreAssoc) == 'y') {
$assocs = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
@ -711,7 +711,7 @@ class ModelTask extends BakeTask {
$associations[$assocs[$assocType]][$i]['associationForeignKey'] = $associationForeignKey;
$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;
}
@ -833,7 +833,7 @@ class ModelTask extends BakeTask {
if (array_search($useTable, $this->_tables) === false) {
$this->out();
$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') {
$useTable = $this->in(__d('cake_console', 'What is the name of the table?'));

View file

@ -62,7 +62,7 @@ class ProjectTask extends AppShell {
$response = false;
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);
$response = $this->in($prompt, array('y','n'), 'n');
$response = $this->in($prompt, array('y', 'n'), 'n');
if (strtolower($response) === 'n') {
$response = $project = false;
}

View file

@ -402,7 +402,7 @@ class TestTask extends BakeTask {
* @return array Array of fixtures the user wants to add.
*/
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();
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'"));

View file

@ -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).");
$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') {
$vars = $this->_loadController();
@ -292,7 +292,7 @@ class ViewTask extends BakeTask {
$pluralHumanName = $this->_pluralHumanName($this->controllerName);
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', 'Path: %s', $this->getPath() . $this->controllerName . DS . Inflector::underscore($action) . ".ctp"));
$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') {
$this->bake($action, ' ');
$this->_stop();

View file

@ -764,7 +764,7 @@ class UpgradeShell extends AppShell {
'help' => __d('cake_console', 'Use git command for moving files around.'),
'boolean' => true
),
'dry-run'=> array(
'dry-run' => array(
'short' => 'd',
'help' => __d('cake_console', 'Dry run the update, no files will actually be modified.'),
'boolean' => true

View file

@ -366,7 +366,7 @@ class Shell extends Object {
return $this->_displayHelp($command);
}
if (($isTask || $isMethod || $isMain) && $command !== 'execute' ) {
if (($isTask || $isMethod || $isMain) && $command !== 'execute') {
$this->startup();
}
@ -672,7 +672,7 @@ class Shell extends Object {
return true;
}
$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';
if ($result) {

View file

@ -143,7 +143,7 @@
if ($this-><?php echo $currentModelName; ?>->delete()) {
<?php if ($wannaUseSession): ?>
$this->Session->setFlash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'));
$this->redirect(array('action'=>'index'));
$this->redirect(array('action' => 'index'));
<?php else: ?>
$this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted'), array('action' => 'index'));
<?php endif; ?>

View file

@ -50,7 +50,7 @@ class <?php echo $controllerName; ?>Controller extends <?php echo $plugin; ?>App
<?php
if (count($helpers)):
echo "/**\n * Helpers\n *\n * @var array\n */\n";
echo "\tvar \$helpers = array(";
echo "\tpublic \$helpers = array(";
for ($i = 0, $len = count($helpers); $i < $len; $i++):
if ($i != $len - 1):
echo "'" . Inflector::camelize($helpers[$i]) . "', ";

View file

@ -39,35 +39,35 @@ class DbAclSchema extends CakeSchema {
}
public $acos = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type'=>'string', 'null' => true),
'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'alias' => array('type'=>'string', 'null' => true),
'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type' => 'string', 'null' => true),
'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'alias' => array('type' => 'string', 'null' => true),
'lft' => 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))
);
public $aros = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type'=>'string', 'null' => true),
'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'alias' => array('type'=>'string', 'null' => true),
'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type' => 'string', 'null' => true),
'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'alias' => array('type' => 'string', 'null' => true),
'lft' => 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))
);
public $aros_acos = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'aro_id' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
'aco_id' => array('type'=>'integer', 'null' => false, 'length' => 10),
'_create' => 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),
'_delete' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
'aco_id' => array('type' => 'integer', 'null' => false, 'length' => 10),
'_create' => 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),
'_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))
);

View file

@ -39,12 +39,12 @@ class i18nSchema extends CakeSchema {
}
public $i18n = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'locale' => array('type'=>'string', 'null' => false, 'length' => 6, 'key' => 'index'),
'model' => array('type'=>'string', 'null' => false, 'key' => 'index'),
'foreign_key' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
'field' => array('type'=>'string', 'null' => false, 'key' => 'index'),
'content' => array('type'=>'text', 'null' => true, 'default' => NULL),
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
'model' => array('type' => 'string', 'null' => false, 'key' => 'index'),
'foreign_key' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
'field' => array('type' => 'string', 'null' => false, 'key' => 'index'),
'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))
);

View file

@ -39,9 +39,9 @@ class SessionsSchema extends CakeSchema {
}
public $cake_sessions = array(
'id' => array('type'=>'string', 'null' => false, 'key' => 'primary'),
'data' => array('type'=>'text', 'null' => true, 'default' => NULL),
'expires' => array('type'=>'integer', 'null' => true, 'default' => NULL),
'id' => array('type' => 'string', 'null' => false, 'key' => 'primary'),
'data' => array('type' => 'text', 'null' => true, 'default' => NULL),
'expires' => array('type' => 'integer', 'null' => true, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
);

View file

@ -239,8 +239,8 @@
*
* Cache::config('default', array(
* 'engine' => 'File', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
* 'prefix' => 'cake_', //[optional] prefix every cache file with this string
* 'lock' => false, //[optional] use file locking
@ -251,8 +251,8 @@
*
* Cache::config('default', array(
* 'engine' => 'Apc', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* ));
*
@ -260,8 +260,8 @@
*
* Cache::config('default', array(
* 'engine' => 'Xcache', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* 'user' => 'user', //user from xcache.admin.user settings
* 'password' => 'password', //plaintext password (xcache.admin.pass)
@ -271,8 +271,8 @@
*
* Cache::config('default', array(
* 'engine' => 'Memcache', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* 'servers' => array(
* '127.0.0.1:11211' // localhost, default port 11211
@ -285,8 +285,8 @@
*
* Cache::config('default', array(
* 'engine' => 'Wincache', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'duration' => 3600, //[optional]
* 'probability' => 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* ));
*/

View file

@ -46,7 +46,7 @@
</div>
<div id="footer">
<?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/',
array('target' => '_blank', 'escape' => false)
);

View file

@ -16,16 +16,16 @@
*/
* {
margin:0;
padding:0;
margin: 0;
padding: 0;
}
/** General Style Info **/
body {
background: #003d4c;
color: #fff;
font-family:'lucida grande',verdana,helvetica,arial,sans-serif;
font-size:90%;
font-family: 'lucida grande', verdana, helvetica, arial, sans-serif;
font-size: 90%;
margin: 0;
}
a {
@ -35,29 +35,29 @@ a {
}
a:hover {
color: #367889;
text-decoration:none;
text-decoration: none;
}
a img {
border:none;
border: none;
}
h1, h2, h3, h4 {
font-weight: normal;
margin-bottom:0.5em;
margin-bottom: 0.5em;
}
h1 {
background:#fff;
background: #fff;
color: #003d4c;
font-size: 100%;
}
h2 {
background:#fff;
background: #fff;
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%;
}
h3 {
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%;
}
h4 {
@ -80,7 +80,7 @@ p {
padding: 10px 20px;
}
#header h1 {
line-height:20px;
line-height: 20px;
background: #003d4c url('../img/cake.icon.png') no-repeat left;
color: #fff;
padding: 0px 30px;
@ -113,35 +113,35 @@ p {
div.form,
div.index,
div.view {
float:right;
width:76%;
border-left:1px solid #666;
padding:10px 2%;
float: right;
width: 76%;
border-left: 1px solid #666;
padding: 10px 2%;
}
div.actions {
float:left;
width:16%;
padding:10px 1.5%;
float: left;
width: 16%;
padding: 10px 1.5%;
}
div.actions h3 {
padding-top:0;
color:#777;
padding-top: 0;
color: #777;
}
/** Tables **/
table {
border-right:0;
border-right: 0;
clear: both;
color: #333;
margin-bottom: 10px;
width: 100%;
}
th {
border:0;
border-bottom:2px solid #555;
border: 0;
border-bottom: 2px solid #555;
text-align: left;
padding:4px;
padding: 4px;
}
th a {
display: block;
@ -158,7 +158,7 @@ table tr td {
padding: 6px;
text-align: left;
vertical-align: top;
border-bottom:1px solid #ddd;
border-bottom: 1px solid #ddd;
}
table tr:nth-child(even) {
background: #f9f9f9;
@ -169,7 +169,7 @@ td.actions {
}
table td.actions a {
margin: 0px 6px;
padding:2px 5px;
padding: 2px 5px;
}
/* SQL log */
@ -182,15 +182,15 @@ table td.actions a {
font-family: Monaco, Consolas, "Courier New", monospaced;
}
.cake-sql-log caption {
color:#fff;
color: #fff;
}
/** Paging **/
.paging {
background:#fff;
background: #fff;
color: #ccc;
margin-top: 1em;
clear:both;
clear: both;
}
.paging .current,
.paging .disabled,
@ -296,7 +296,7 @@ form .required {
form .required label:after {
color: #e32;
content: '*';
display:inline;
display: inline;
}
form div.submit {
border: 0;
@ -306,14 +306,14 @@ form div.submit {
label {
display: block;
font-size: 110%;
margin-bottom:3px;
margin-bottom: 3px;
}
input, textarea {
clear: both;
font-size: 140%;
font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif;
padding: 1%;
width:98%;
width: 98%;
}
select {
clear: both;
@ -337,8 +337,8 @@ div.checkbox label {
display: inline;
}
input[type=radio] {
float:left;
width:auto;
float: left;
width: auto;
margin: 6px 0;
padding: 0;
line-height: 26px;
@ -353,7 +353,7 @@ input[type=submit] {
width: auto;
}
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-linear-gradient(top, #76BF6B, #3B8230);
background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
@ -491,7 +491,7 @@ p.error em {
padding: 0;
}
.actions li {
margin:0 0 0.5em 0;
margin: 0 0 0.5em 0;
list-style-type: none;
white-space: nowrap;
padding: 0;
@ -506,7 +506,7 @@ p.error em {
input[type=submit],
.actions ul li a,
.actions a {
font-weight:normal;
font-weight: normal;
padding: 4px 8px;
background: #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: -o-linear-gradient(top, #fefefe, #dcdcdc);
background-image: linear-gradient(top, #fefefe, #dcdcdc);
color:#333;
border:1px solid #bbb;
color: #333;
border: 1px solid #bbb;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
@ -661,50 +661,50 @@ pre {
background-color: rgba(255, 255, 0, 0.5);
}
.code-coverage-results div.code-line {
padding-left:5px;
display:block;
margin-left:10px;
padding-left: 5px;
display: block;
margin-left: 10px;
}
.code-coverage-results div.uncovered span.content {
background:#ecc;
background: #ecc;
}
.code-coverage-results div.covered span.content {
background:#cec;
background: #cec;
}
.code-coverage-results div.ignored span.content {
color:#aaa;
color: #aaa;
}
.code-coverage-results span.line-num {
color:#666;
display:block;
float:left;
width:20px;
text-align:right;
margin-right:5px;
color: #666;
display: block;
float: left;
width: 20px;
text-align: right;
margin-right: 5px;
}
.code-coverage-results span.line-num strong {
color:#666;
color: #666;
}
.code-coverage-results div.start {
border:1px solid #aaa;
border-width:1px 1px 0px 1px;
margin-top:30px;
padding-top:5px;
border: 1px solid #aaa;
border-width: 1px 1px 0px 1px;
margin-top: 30px;
padding-top: 5px;
}
.code-coverage-results div.end {
border:1px solid #aaa;
border-width:0px 1px 1px 1px;
margin-bottom:30px;
padding-bottom:5px;
border: 1px solid #aaa;
border-width: 0px 1px 1px 1px;
margin-bottom: 30px;
padding-bottom: 5px;
}
.code-coverage-results div.realstart {
margin-top:0px;
margin-top: 0px;
}
.code-coverage-results p.note {
color:#bbb;
padding:5px;
margin:5px 0 10px;
font-size:10px;
color: #bbb;
padding: 5px;
margin: 5px 0 10px;
font-size: 10px;
}
.code-coverage-results span.result-bad {
color: #a00;
@ -718,5 +718,5 @@ pre {
/** Elements **/
#url-rewriting-warning {
display:none;
display: none;
}

View file

@ -511,7 +511,7 @@ class I18n {
continue;
}
$mustEscape = array($escape . ',' , $escape . ';', $escape . '<', $escape . '>', $escape . $escape);
$mustEscape = array($escape . ',', $escape . ';', $escape . '<', $escape . '>', $escape . $escape);
$replacements = array_map('crc32', $mustEscape);
$value = str_replace($mustEscape, $replacements, $value);
$value = explode(';', $value);

View file

@ -349,7 +349,7 @@ class ContainableBehavior extends ModelBehavior {
}
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);

View file

@ -38,7 +38,7 @@ class TranslateBehavior extends ModelBehavior {
* Callback
*
* $config for TranslateBehavior should be
* array( 'fields' => array('field_one',
* array('fields' => array('field_one',
* 'field_two' => 'FieldAssoc', 'field_three'))
*
* With above example only one permanent hasMany will be joined (for field_two

View file

@ -402,7 +402,7 @@ class CakeSchema extends Object {
if ($field != 'indexes' && $field != 'tableParameters') {
if (is_string($value)) {
$type = $value;
$value = array('type'=> $type);
$value = array('type' => $type);
}
$col = "\t\t'{$field}' => array('type' => '" . $value['type'] . "', ";
unset($value['type']);

View file

@ -165,7 +165,7 @@ class Sqlite extends DboSource {
if ($cache != null) {
return $cache;
}
$table = $this->fullTableName($model);
$table = $this->fullTableName($model, false);
$fields = array();
$result = $this->_execute('PRAGMA table_info(' . $table . ')');
@ -297,7 +297,7 @@ class Sqlite extends DboSource {
continue;
}
if (preg_match('/\bAS\s+(.*)/i', $selects[$j], $matches)) {
$columnName = trim($matches[1],'"');
$columnName = trim($matches[1], '"');
} else {
$columnName = trim(str_replace('"', '', $selects[$j]));
}

View file

@ -2877,7 +2877,7 @@ class DboSource extends DataSource {
/**
* 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'.
* @return string
*/
@ -2911,7 +2911,7 @@ class DboSource extends DataSource {
$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;
}
$out = $this->_buildFieldParameters($out, $column, 'beforeDefault');

View file

@ -25,6 +25,7 @@
App::uses('ClassRegistry', 'Utility');
App::uses('Validation', 'Utility');
App::uses('String', 'Utility');
App::uses('Set', 'Utility');
App::uses('BehaviorCollection', 'Model');
App::uses('ModelBehavior', 'Model');
App::uses('ConnectionManager', 'Model');
@ -536,7 +537,7 @@ class Model extends Object {
*/
protected $_associationKeys = array(
'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'),
'hasAndBelongsToMany' => array('className', 'joinTable', 'with', 'foreignKey', 'associationForeignKey', 'conditions', 'fields', 'order', 'limit', 'offset', 'unique', 'finderQuery', 'deleteQuery', 'insertQuery')
);

View file

@ -256,7 +256,7 @@ class BasicsTest extends CakeTestCase {
$this->assertEquals($expected, $result);
$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);
}

View file

@ -135,8 +135,8 @@ class CacheTest extends CakeTestCase {
public function testReadNonExistingConfig() {
$this->assertFalse(Cache::read('key', 'totally fake'));
$this->assertFalse(Cache::write('key', 'value', 'totally fake'));
$this->assertFalse(Cache::increment('key', 'value', 'totally fake'));
$this->assertFalse(Cache::decrement('key', 'value', 'totally fake'));
$this->assertFalse(Cache::increment('key', 1, 'totally fake'));
$this->assertFalse(Cache::decrement('key', 1, 'totally fake'));
}
/**
@ -161,10 +161,10 @@ class CacheTest extends CakeTestCase {
$_cacheConfigSessions = Cache::config('sessions');
$_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'));
$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'));
Cache::config('sessions', $_cacheConfigSessions['settings']);
@ -335,7 +335,7 @@ class CacheTest extends CakeTestCase {
*/
public function testCacheDisable() {
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->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');
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::read('key_4', 'test_cache_disable_2'));

View file

@ -61,10 +61,10 @@ class FileEngineTest extends CakeTestCase {
* @return void
*/
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'));
$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->assertNotEquals($result['settings'], Cache::settings('default'));
}
@ -276,7 +276,7 @@ class FileEngineTest extends CakeTestCase {
public function testRemoveWindowsSlashesFromCache() {
Cache::config('windows_test', array('engine' => 'File', 'isWindows' => true, 'prefix' => null, 'path' => TMP));
$expected = array (
$expected = array(
'C:\dev\prj2\sites\cake\libs' => array(
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',

View file

@ -81,7 +81,7 @@ class MemcacheEngineTest extends CakeTestCase {
unset($settings['serialize'], $settings['path']);
$expecting = array(
'prefix' => 'cake_',
'duration'=> 3600,
'duration' => 3600,
'probability' => 100,
'servers' => array('127.0.0.1'),
'persistent' => true,
@ -312,12 +312,12 @@ class MemcacheEngineTest extends CakeTestCase {
public function testConfigurationConflict() {
Cache::config('long_memcache', array(
'engine' => 'Memcache',
'duration'=> '+2 seconds',
'duration' => '+2 seconds',
'servers' => array('127.0.0.1:11211'),
));
Cache::config('short_memcache', array(
'engine' => 'Memcache',
'duration'=> '+1 seconds',
'duration' => '+1 seconds',
'servers' => array('127.0.0.1:11211'),
));
Cache::config('some_file', array('engine' => 'File'));

View file

@ -59,7 +59,7 @@ class XcacheEngineTest extends CakeTestCase {
$settings = Cache::settings();
$expecting = array(
'prefix' => 'cake_',
'duration'=> 3600,
'duration' => 3600,
'probability' => 100,
'engine' => 'Xcache',
);

View file

@ -274,8 +274,8 @@ class ControllerTaskTest extends CakeTestCase {
$this->assertContains(' * @property AclComponent $Acl', $result);
$this->assertContains(' * @property AuthComponent $Auth', $result);
$this->assertContains('class ArticlesController extends AppController', $result);
$this->assertContains("\$components = array('Acl', 'Auth')", $result);
$this->assertContains("\$helpers = array('Ajax', 'Time')", $result);
$this->assertContains("public \$components = array('Acl', 'Auth')", $result);
$this->assertContains("public \$helpers = array('Ajax', 'Time')", $result);
$this->assertContains("--actions--", $result);
$result = $this->Task->bake('Articles', 'scaffold', $helpers, $components);

View file

@ -782,7 +782,7 @@ class AuthComponentTest extends CakeTestCase {
$this->Auth->Session->delete('Auth');
$_SERVER['HTTP_REFERER'] = $_ENV['HTTP_REFERER'] = Router::url('/admin', true);
$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->url = 'auth_test/login';

View file

@ -102,12 +102,12 @@ class CookieComponentTest extends CakeTestCase {
* @return void
*/
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.version' => '1.2.0.x'));
$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.version' => '1.2.0.x'), 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() {
$this->_setCookieData();
$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);
$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);
}
@ -162,11 +162,11 @@ class CookieComponentTest extends CakeTestCase {
$this->_setCookieData();
$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);
$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);
}
@ -279,7 +279,7 @@ class CookieComponentTest extends CakeTestCase {
$this->_setCookieData();
$this->Cookie->delete('Encrytped_multi_cookies.name');
$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->Cookie->delete('Encrytped_array');
@ -288,7 +288,7 @@ class CookieComponentTest extends CakeTestCase {
$this->Cookie->delete('Plain_multi_cookies.name');
$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->Cookie->delete('Plain_array');
@ -372,7 +372,7 @@ class CookieComponentTest extends CakeTestCase {
$this->assertNull($data);
$_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(
'name' => $this->__encrypt('CakePHP'),
'version' => $this->__encrypt('1.2.0.x'),
@ -386,19 +386,19 @@ class CookieComponentTest extends CakeTestCase {
$this->Cookie->startup(null);
$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);
$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);
$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);
$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->Cookie->destroy();
unset($_COOKIE['CakeTestCookie']);
@ -427,7 +427,7 @@ class CookieComponentTest extends CakeTestCase {
$this->assertEquals($expected, $data);
$_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(
'name' => $this->__encrypt('CakePHP'),
'version' => $this->__encrypt('1.2.0.x'),
@ -439,19 +439,19 @@ class CookieComponentTest extends CakeTestCase {
'tag' => 'CakePHP Rocks!'));
$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);
$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);
$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);
$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->Cookie->destroy();
unset($_COOKIE['CakeTestCookie']);

View file

@ -1291,7 +1291,7 @@ class ControllerTest extends CakeTestCase {
*/
public function testInvokeActionPrefixProtection() {
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->addParams(array('controller' => 'test_controller', 'action' => 'admin_add'));

View file

@ -161,7 +161,7 @@ class ScaffoldTest extends CakeTestCase {
'pass' => array(),
'form' => array(),
'named' => array(),
'url' => array('url' =>'admin/scaffold_mock/edit'),
'url' => array('url' => 'admin/scaffold_mock/edit'),
'controller' => 'scaffold_mock',
'action' => 'admin_edit',
'admin' => true,
@ -191,7 +191,7 @@ class ScaffoldTest extends CakeTestCase {
'pass' => array(),
'form' => array(),
'named' => array(),
'url' => array('url' =>'admin/scaffold_mock/edit'),
'url' => array('url' => 'admin/scaffold_mock/edit'),
'controller' => 'scaffold_mock',
'action' => 'admin_edit',
'admin' => true,
@ -245,7 +245,7 @@ class ScaffoldTest extends CakeTestCase {
'pass' => array(1),
'form' => array(),
'named' => array(),
'url' => array('url' =>'scaffold_mock'),
'url' => array('url' => 'scaffold_mock'),
'controller' => 'scaffold_mock',
'action' => 'edit',
);
@ -285,7 +285,7 @@ class ScaffoldTest extends CakeTestCase {
'pass' => array(1),
'form' => array(),
'named' => array(),
'url' => array('url' =>'scaffold_mock'),
'url' => array('url' => 'scaffold_mock'),
'controller' => 'scaffold_mock',
'action' => 'edit',
);
@ -323,7 +323,7 @@ class ScaffoldTest extends CakeTestCase {
'pass' => array(1),
'form' => array(),
'named' => array(),
'url' => array('url' =>'scaffold_mock/edit'),
'url' => array('url' => 'scaffold_mock/edit'),
'controller' => 'scaffold_mock',
'action' => 'edit',
);

View file

@ -2923,7 +2923,7 @@ class ContainableBehaviorTest extends CakeTestCase {
if (!empty($result)) {
foreach ($result as $i => $article) {
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));
}
}
}

View file

@ -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' => 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' => 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)));
$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' => 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' => 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))
);
$this->assertEquals($total, $expects);

View file

@ -135,7 +135,7 @@ class TreeBehaviorScopedTest extends CakeTestCase {
*/
public function testMoveUpWithScope() {
$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->id = 4;

View file

@ -665,7 +665,7 @@ class BehaviorCollectionTest extends CakeTestCase {
array(
'Apple' => array('id' => 1),
'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(
'Apple' => array('id' => 2),
'Child' => array(
@ -737,7 +737,7 @@ class BehaviorCollectionTest extends CakeTestCase {
array(
'Apple' => array('id' => 1),
'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(
'Apple' => array('id' => 2),
'Child' => array(
@ -807,13 +807,13 @@ class BehaviorCollectionTest extends CakeTestCase {
$expected2 = array(
array(
'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(
'Apple' => array('id' => 2),
'Parent' => array('id' => 1, 'name' => 'Red Apple 1', 'mytime' => '22:57:17')),
array(
'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(
'fields' => array('Apple.id', 'Parent.id', 'Parent.name', 'Parent.mytime'),

View file

@ -1302,7 +1302,7 @@ class MysqlTest extends CakeTestCase {
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
$binding = array('type'=>'belongsTo', 'model'=>'TestModel4');
$binding = array('type' => 'belongsTo', 'model' => 'TestModel4');
$queryData = array();
$resultSet = null;
$null = null;
@ -1711,7 +1711,7 @@ class MysqlTest extends CakeTestCase {
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
$binding = array('type'=>'hasAndBelongsToMany', 'model'=>'TestModel7');
$binding = array('type' => 'hasAndBelongsToMany', 'model' => 'TestModel7');
$queryData = array('conditions' => array('TestModel4.name !=' => 'mariano'));
$resultSet = null;
$null = null;
@ -1744,7 +1744,7 @@ class MysqlTest extends CakeTestCase {
$this->Model->hasAndBelongsToMany['TestModel7']['offset'] = 2;
$this->Model->hasAndBelongsToMany['TestModel7']['limit'] = 5;
$binding = array('type'=>'hasAndBelongsToMany', 'model'=>'TestModel7');
$binding = array('type' => 'hasAndBelongsToMany', 'model' => 'TestModel7');
$queryData = array();
$resultSet = null;
$null = null;
@ -1780,7 +1780,7 @@ class MysqlTest extends CakeTestCase {
$this->Model->hasAndBelongsToMany['TestModel7']['page'] = 2;
$this->Model->hasAndBelongsToMany['TestModel7']['limit'] = 5;
$binding = array('type'=>'hasAndBelongsToMany', 'model'=>'TestModel7');
$binding = array('type' => 'hasAndBelongsToMany', 'model' => 'TestModel7');
$queryData = array();
$resultSet = null;
$null = null;
@ -1851,7 +1851,7 @@ class MysqlTest extends CakeTestCase {
$expected = " WHERE score BETWEEN 90.1 AND 95.7";
$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)";
$this->assertEquals($expected, $result);

View file

@ -490,13 +490,13 @@ class PostgresTest extends CakeTestCase {
'type' => 'integer', 'null' => false, 'default' => null,
'length' => 10, 'key' => 'primary'
),
'locale' => array('type'=>'string', 'null' => false, 'length' => 6, 'key' => 'index'),
'model' => array('type'=>'string', 'null' => false, 'key' => 'index'),
'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
'model' => array('type' => 'string', 'null' => false, 'key' => 'index'),
'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'),
'content' => array('type'=>'text', 'null' => true, 'default' => null),
'field' => array('type' => 'string', 'null' => false, 'key' => 'index'),
'content' => array('type' => 'text', 'null' => true, 'default' => null),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1),
'locale' => array('column' => 'locale', 'unique' => 0),

View file

@ -262,6 +262,10 @@ class SqliteTest extends CakeTestCase {
public function testDescribe() {
$this->loadFixtures('User');
$Model = new Model(array('name' => 'User', 'ds' => 'test', 'table' => 'users'));
$this->Dbo->cacheSources = true;
Configure::write('Cache.disable', false);
$result = $this->Dbo->describe($Model);
$expected = array(
'id' => array(
@ -300,6 +304,9 @@ class SqliteTest extends CakeTestCase {
$result = $this->Dbo->describe($Model->useTable);
$this->assertEquals($expected, $result);
$result = Cache::read('test_users', '_cake_model_');
$this->assertEquals($expected, $result);
}
/**

View file

@ -245,13 +245,13 @@ class ModelIntegrationTest extends BaseModelTest {
$this->loadFixtures('Article', 'User');
$TestUser =& new User();
$options = array (
$options = array(
'fields' => array(
'user',
'Article.published',
),
'joins' => array (
array (
'joins' => array(
array(
'table' => 'articles',
'alias' => 'Article',
'type' => 'LEFT',
@ -678,7 +678,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$TestModel->set($data);
$expected = array('Apple'=> array('mytime'=> ''));
$expected = array('Apple' => array('mytime' => ''));
$this->assertEquals($TestModel->data, $expected);
$data = array();
@ -688,7 +688,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$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');
$data = array();
@ -698,7 +698,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$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');
$data = array();
@ -707,7 +707,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$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');
$data = array();
@ -717,7 +717,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$TestModel->set($data);
$expected = array('Apple'=> array('mytime'=> '03:04:04'));
$expected = array('Apple' => array('mytime' => '03:04:04'));
$this->assertEquals($TestModel->data, $expected);
$data = array();
@ -727,7 +727,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$TestModel->set($data);
$expected = array('Apple' => array('mytime'=> '03:04:04'));
$expected = array('Apple' => array('mytime' => '03:04:04'));
$this->assertEquals($TestModel->data, $expected);
$data = array();
@ -737,7 +737,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$TestModel->set($data);
$expected = array('Apple'=> array('mytime'=> '03:04:04'));
$expected = array('Apple' => array('mytime' => '03:04:04'));
$this->assertEquals($TestModel->data, $expected);
$db = ConnectionManager::getDataSource('test');
@ -769,7 +769,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$TestModel->set($data);
$expected = array('Apple'=> array('created'=> ''));
$expected = array('Apple' => array('created' => ''));
$this->assertEquals($TestModel->data, $expected);
$data = array();
@ -779,7 +779,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$TestModel->set($data);
$expected = array('Apple'=> array('date'=> ''));
$expected = array('Apple' => array('date' => ''));
$this->assertEquals($TestModel->data, $expected);
$data = array();
@ -792,7 +792,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$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);
$data = array();
@ -805,7 +805,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$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);
$data = array();
@ -818,7 +818,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$TestModel->set($data);
$expected = array('Apple'=> array('created'=> ''));
$expected = array('Apple' => array('created' => ''));
$this->assertEquals($TestModel->data, $expected);
$data = array();
@ -827,7 +827,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$TestModel->set($data);
$expected = array('Apple'=> array('created'=> ''));
$expected = array('Apple' => array('created' => ''));
$this->assertEquals($TestModel->data, $expected);
$data = array();
@ -837,7 +837,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$TestModel->set($data);
$expected = array('Apple'=> array('created'=> ''));
$expected = array('Apple' => array('created' => ''));
$this->assertEquals($TestModel->data, $expected);
$data = array();
@ -850,9 +850,9 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$TestModel->set($data);
$expected = array(
'Apple'=> array(
'created'=> '',
'date'=> '2006-12-25'
'Apple' => array(
'created' => '',
'date' => '2006-12-25'
));
$this->assertEquals($TestModel->data, $expected);
@ -870,9 +870,9 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$TestModel->set($data);
$expected = array(
'Apple'=> array(
'created'=> '2007-08-20 10:12:09',
'date'=> '2006-12-25'
'Apple' => array(
'created' => '2007-08-20 10:12:09',
'date' => '2006-12-25'
));
$this->assertEquals($TestModel->data, $expected);
@ -889,7 +889,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$TestModel->set($data);
$expected = array('Apple'=> array('created'=> '', 'date'=> ''));
$expected = array('Apple' => array('created' => '', 'date' => ''));
$this->assertEquals($TestModel->data, $expected);
$data = array();
@ -905,7 +905,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$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);
$data = array();
@ -915,7 +915,7 @@ class ModelIntegrationTest extends BaseModelTest {
$TestModel->data = null;
$TestModel->set($data);
$expected = array('Apple'=> array('date'=> '2006-12-25'));
$expected = array('Apple' => array('date' => '2006-12-25'));
$this->assertEquals($TestModel->data, $expected);
$db = ConnectionManager::getDataSource('test');
@ -1954,7 +1954,7 @@ class ModelIntegrationTest extends BaseModelTest {
'default' => null,
'length' => null
),
'updated'=> array(
'updated' => array(
'type' => 'datetime',
'null' => true,
'default' => null,

View file

@ -143,7 +143,7 @@ class ModelReadTest extends BaseModelTest {
$rows = $Thread->find('all', array(
'group' => 'Thread.project_id',
'fields' => array('Thread.project_id', 'COUNT(*) AS total'),
'order'=> 'Thread.project_id'
'order' => 'Thread.project_id'
));
$result = array();
foreach ($rows as $row) {
@ -211,19 +211,19 @@ class ModelReadTest extends BaseModelTest {
$expected = array(
array('Product' => array('type' => 'Clothing'), array('price' => 32)),
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))
);
$result = $Product->find('all',array(
'fields'=>array('Product.type', 'MIN(Product.price) as price'),
'group'=> 'Product.type',
'fields' => array('Product.type', 'MIN(Product.price) as price'),
'group' => 'Product.type',
'order' => 'Product.type ASC'
));
$this->assertEquals($expected, $result);
$result = $Product->find('all', array(
'fields'=>array('Product.type', 'MIN(Product.price) as price'),
'group'=> array('Product.type'),
'fields' => array('Product.type', 'MIN(Product.price) as price'),
'group' => array('Product.type'),
'order' => 'Product.type ASC'));
$this->assertEquals($expected, $result);
}
@ -386,7 +386,7 @@ class ModelReadTest extends BaseModelTest {
$result = $TestModel->find('all');
$expected = array(
array(
'Apple' => array (
'Apple' => array(
'id' => 1,
'apple_id' => 2,
'color' => 'Red 1',
@ -452,7 +452,7 @@ class ModelReadTest extends BaseModelTest {
'mytime' => '22:57:17'
))),
'Sample' => array(
'id' =>'',
'id' => '',
'apple_id' => '',
'name' => ''
),
@ -1133,7 +1133,7 @@ class ModelReadTest extends BaseModelTest {
'mytime' => '22:57:17'
))),
'Sample' => array(
'id' =>'',
'id' => '',
'apple_id' => '',
'name' => ''
),
@ -1742,7 +1742,7 @@ class ModelReadTest extends BaseModelTest {
$result = $TestModel->find('all');
$expected = array(
array(
'Apple' => array (
'Apple' => array(
'id' => 1,
'apple_id' => 2,
'color' => 'Red 1',
@ -1803,7 +1803,7 @@ class ModelReadTest extends BaseModelTest {
'mytime' => '22:57:17'
))),
'Sample' => array(
'id' =>'',
'id' => '',
'apple_id' => '',
'name' => ''
)),
@ -2237,7 +2237,7 @@ class ModelReadTest extends BaseModelTest {
'mytime' => '22:57:17'
))),
'Sample' => array(
'id' =>'',
'id' => '',
'apple_id' => '',
'name' => ''
)),
@ -2646,7 +2646,7 @@ class ModelReadTest extends BaseModelTest {
'mytime' => '22:57:17'
))),
'Sample' => array(
'id' =>'',
'id' => '',
'apple_id' => '',
'name' => ''
)),
@ -3397,38 +3397,38 @@ class ModelReadTest extends BaseModelTest {
'fields' => 'id, name, parent_id',
'conditions' => array('Category.id !=' => 1)
));
$expected = array (
array ('Category' => array(
$expected = array(
array('Category' => array(
'id' => '2',
'name' => 'Category 1.1',
'parent_id' => '1'
)),
array ('Category' => array(
array('Category' => array(
'id' => '3',
'name' => 'Category 1.2',
'parent_id' => '1'
)),
array ('Category' => array(
array('Category' => array(
'id' => '4',
'name' => 'Category 2',
'parent_id' => '0'
)),
array ('Category' => array(
array('Category' => array(
'id' => '5',
'name' => 'Category 3',
'parent_id' => '0'
)),
array ('Category' => array(
array('Category' => array(
'id' => '6',
'name' => 'Category 3.1',
'parent_id' => '5'
)),
array ('Category' => array(
array('Category' => array(
'id' => '7',
'name' => 'Category 1.1.1',
'parent_id' => '2'
)),
array ('Category' => array(
array('Category' => array(
'id' => '8',
'name' => 'Category 1.1.2',
'parent_id' => '2'
@ -6087,7 +6087,7 @@ class ModelReadTest extends BaseModelTest {
'conditions' => array(
'user' => 'larry'),
'fields' => NULL,
'joins' => array (),
'joins' => array(),
'limit' => NULL,
'offset' => NULL,
'order' => array(

View file

@ -435,7 +435,7 @@ class ModelWriteTest extends BaseModelTest {
$TestModel2->save(array(
'name' => 'Item 7',
'syfile_id' => 1,
'published'=> true
'published' => true
));
$result = $TestModel->findById(1);
@ -450,7 +450,7 @@ class ModelWriteTest extends BaseModelTest {
$TestModel2->save(array(
'id' => 1,
'syfile_id' => 1,
'published'=> false
'published' => false
));
$result = $TestModel->findById(1);
@ -993,11 +993,11 @@ class ModelWriteTest extends BaseModelTest {
$TestModel->recursive = -1;
$result = $TestModel->find('all', array('fields' => array('id', 'title')));
$expected = array(
array('Article' => array('id' => 1, 'title' => 'First Article' )),
array('Article' => array('id' => 2, 'title' => 'Second Article' )),
array('Article' => array('id' => 3, 'title' => 'Third Article' )),
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' => 1, 'title' => 'First Article')),
array('Article' => array('id' => 2, 'title' => 'Second Article')),
array('Article' => array('id' => 3, 'title' => 'Third Article')),
array('Article' => array('id' => 4, 'title' => 'Fourth Article - New Title')),
array('Article' => array('id' => 5, 'title' => 'Fifth Article - New Title 5'))
);
$this->assertEquals($expected, $result);
}
@ -3661,7 +3661,7 @@ class ModelWriteTest extends BaseModelTest {
1 => array('title' => 'title 1'),
2 => array('title' => 'title 2'),
),
array('validate'=>'only')
array('validate' => 'only')
);
$this->assertFalse($result);
$expected = array(
@ -3675,7 +3675,7 @@ class ModelWriteTest extends BaseModelTest {
1 => array('title' => ''),
2 => array('title' => 'title 2'),
),
array('validate'=>'only')
array('validate' => 'only')
);
$this->assertFalse($result);
$expected = array(
@ -3778,7 +3778,7 @@ class ModelWriteTest extends BaseModelTest {
),
array(
'body' => 3,
'published' =>'sd',
'published' => 'sd',
),
);
$Something->create();
@ -3810,7 +3810,7 @@ class ModelWriteTest extends BaseModelTest {
array(
'title' => 'valid',
'body' => 'this body',
'published' =>'sd',
'published' => 'sd',
),
);
$Something->create();
@ -5083,7 +5083,7 @@ class ModelWriteTest extends BaseModelTest {
),
array(
'body' => 3,
'published' =>'sd',
'published' => 'sd',
),
);
$Something->create();
@ -5115,7 +5115,7 @@ class ModelWriteTest extends BaseModelTest {
array(
'title' => 'valid',
'body' => 'this body',
'published' =>'sd',
'published' => 'sd',
),
);
$Something->create();
@ -5305,7 +5305,7 @@ class ModelWriteTest extends BaseModelTest {
$results = $ProductUpdateAll->find('all', compact('conditions'));
$this->assertTrue(!empty($results));
$ProductUpdateAll->bindModel(array('belongsTo'=>array('Group')));
$ProductUpdateAll->bindModel(array('belongsTo' => array('Group')));
$ProductUpdateAll->belongsTo = array(
'Group' => array(
'className' => 'GroupUpdateAll',
@ -5431,7 +5431,7 @@ class ModelWriteTest extends BaseModelTest {
);
$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(
'0' => array(
'ProductUpdateAll' => array(

View file

@ -46,12 +46,12 @@ class Test extends CakeTestModel {
* @var array
*/
protected $_schema = array(
'id'=> array('type' => 'integer', 'null' => '', 'default' => '1', 'length' => '8', 'key'=>'primary'),
'name'=> array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
'email'=> array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'),
'notes'=> array('type' => 'text', 'null' => '1', 'default' => 'write some notes here', 'length' => ''),
'created'=> array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''),
'updated'=> array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
'id' => array('type' => 'integer', 'null' => '', 'default' => '1', 'length' => '8', 'key' => 'primary'),
'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
'email' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'),
'notes' => array('type' => 'text', 'null' => '1', 'default' => 'write some notes here', 'length' => ''),
'created' => array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''),
'updated' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
);
}
@ -89,12 +89,12 @@ class TestAlias extends CakeTestModel {
* @var array
*/
protected $_schema = array(
'id'=> array('type' => 'integer', 'null' => '', 'default' => '1', 'length' => '8', 'key'=>'primary'),
'name'=> array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
'email'=> array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'),
'notes'=> array('type' => 'text', 'null' => '1', 'default' => 'write some notes here', 'length' => ''),
'created'=> array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''),
'updated'=> array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
'id' => array('type' => 'integer', 'null' => '', 'default' => '1', 'length' => '8', 'key' => 'primary'),
'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
'email' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'),
'notes' => array('type' => 'text', 'null' => '1', 'default' => 'write some notes here', 'length' => ''),
'created' => array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''),
'updated' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
);
}
@ -2543,7 +2543,7 @@ class Campaign extends CakeTestModel {
*
* @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
*/
public $hasMany = array(
'Group'=> array(
'Group' => array(
'className' => 'Group'
),
'User2' => array(
@ -4056,9 +4056,9 @@ class Category2 extends CakeTestModel {
),
'Article2' => array(
'className' => 'Article2',
'order'=>'Article2.published_date DESC',
'order' => 'Article2.published_date DESC',
'foreignKey' => 'category_id',
'limit'=>'3')
'limit' => '3')
);
/**
@ -4363,7 +4363,7 @@ class ArticleFeatured2 extends CakeTestModel {
* @var array
*/
public $hasMany = array(
'Comment2' => array('className'=>'Comment2', 'dependent' => true)
'Comment2' => array('className' => 'Comment2', 'dependent' => true)
);
/**

View file

@ -317,7 +317,7 @@ class HttpSocketTest extends CakeTestCase {
'port' => 80,
'timeout' => 30,
'request' => array(
'uri' => array (
'uri' => array(
'scheme' => 'http',
'host' => 'www.cakephp.org',
'port' => 80

View file

@ -854,8 +854,8 @@ class DispatcherTest extends CakeTestCase {
$result = $Dispatcher->parseParams($url);
$expected = array(
'pass' => array('home'),
'named' => array('param'=> 'value', 'param2'=> 'value2'), 'plugin'=> 'my_plugin',
'controller'=> 'some_pages', 'action'=> 'display'
'named' => array('param' => 'value', 'param2' => 'value2'), 'plugin' => 'my_plugin',
'controller' => 'some_pages', 'action' => 'display'
);
foreach ($expected as $key => $value) {
$this->assertEquals($result[$key], $value, 'Value mismatch ' . $key . ' %');
@ -864,7 +864,7 @@ class DispatcherTest extends CakeTestCase {
$this->assertSame($controller->plugin, 'MyPlugin');
$this->assertSame($controller->name, 'SomePages');
$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->action, 'admin_add');
$expected = array(0 => 5, 'param'=>'value', 'param2'=>'value2');
$expected = array(0 => 5, 'param' => 'value', 'param2' => 'value2');
$this->assertEquals($controller->passedArgs, $expected);
Configure::write('Routing.prefixes', array('admin'));
@ -985,7 +985,7 @@ class DispatcherTest extends CakeTestCase {
$this->assertSame($controller->action, 'admin_index');
$expected = array(
'pass'=> array(),
'pass' => array(),
'named' => array(),
'controller' => 'articles_test',
'plugin' => 'articles_test',
@ -1081,7 +1081,7 @@ class DispatcherTest extends CakeTestCase {
$url = new CakeRequest('my_plugin/not_here/param:value/param2:value2');
$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');
$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');
try {
$controller = $Dispatcher->dispatch($url, $response, array('return'=> 1));
$controller = $Dispatcher->dispatch($url, $response, array('return' => 1));
$this->fail('No exception.');
} catch (MissingActionException $e) {
$this->assertEquals('Action SomePostsController::view() could not be found.', $e->getMessage());
@ -1490,7 +1490,7 @@ class DispatcherTest extends CakeTestCase {
'App' => Configure::read('App'),
'GET' => $_GET,
'POST' => $_POST,
'SERVER'=> $_SERVER
'SERVER' => $_SERVER
);
}

View file

@ -513,7 +513,7 @@ class RouterTest extends CakeTestCase {
* @return void
**/
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';
$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'));
$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);
Router::reload();
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');
$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);
Router::reload();
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');
$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);
Router::reload();
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');
$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);
Router::reload();
Router::connect('/posts/:year/:month/:day/*', array('controller' => 'posts', 'action' => 'view'));
$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);
Router::reload();
@ -1261,7 +1261,7 @@ class RouterTest extends CakeTestCase {
require CAKE . 'Config' . DS . 'routes.php';
$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);
$result = Router::parse('/posts/view/1.rss');
@ -1281,7 +1281,7 @@ class RouterTest extends CakeTestCase {
Router::parseExtensions('rss', '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);
$result = Router::parse('/posts.atom?hello=goodbye');
@ -1308,25 +1308,25 @@ class RouterTest extends CakeTestCase {
* @return void
*/
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';
$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);
$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);
// Test bug #4614
$restore = ini_get('arg_separator.output');
ini_set('arg_separator.output', '&amp;');
$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);
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&amp;var2=test2';
$this->assertEquals($expected, $result);
}
@ -1378,7 +1378,7 @@ class RouterTest extends CakeTestCase {
Router::reload();
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('/:id/*', array('controller' => 'graphs', 'action' => 'view'), array('id' => $ID));
@ -1418,7 +1418,7 @@ class RouterTest extends CakeTestCase {
Router::setRequestInfo($request);
$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";
$this->assertEquals($expected, $result);
}
@ -1739,7 +1739,7 @@ class RouterTest extends CakeTestCase {
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
$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);
$result = Router::parse('/pages/home/');
@ -1771,7 +1771,7 @@ class RouterTest extends CakeTestCase {
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
$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);
}
@ -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);
$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';
$this->assertEquals($expected, $result);

View file

@ -74,7 +74,7 @@ class FileTest extends CakeTestCase {
$result = $this->File->info();
$expecting = array(
'dirname' => dirname(__FILE__), 'basename' => basename(__FILE__),
'extension' => 'php', 'filename' =>'FileTest'
'extension' => 'php', 'filename' => 'FileTest'
);
$this->assertEquals($expecting, $result);

View file

@ -1464,7 +1464,7 @@ class SetTest extends CakeTestCase {
$this->assertEquals($expected, $result);
$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);
$result = Set::extract($a, '1.Article.title');
@ -1491,7 +1491,7 @@ class SetTest extends CakeTestCase {
);
$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);
$a = array(
@ -1518,7 +1518,7 @@ class SetTest extends CakeTestCase {
);
$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);
$result = Set::extract($a, '{n}.Article.Comment.{n}.title');
@ -1545,7 +1545,7 @@ class SetTest extends CakeTestCase {
$a = array(
0 => array('pages' => array('name' => 'page')),
1 => array('fruites'=> array('name' => 'fruit')),
1 => array('fruites' => array('name' => 'fruit')),
'test' => array(array('name' => 'jippi')),
'dot.test' => array(array('name' => 'jippi'))
);
@ -1946,11 +1946,11 @@ class SetTest extends CakeTestCase {
$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');
$expected = array (
1 => array (
$expected = array(
1 => array(
2 => 'mariano.iglesias: Mariano Iglesias',
25 => 'gwoo: The Gwoo'),
2 => array (14 => 'phpnut: Larry E. Masters'));
2 => array(14 => 'phpnut: Larry E. Masters'));
$this->assertEquals($expected, $result);
$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);
$expected = array(
'Post' => array('id'=> 1, 'title' => 'First Post'),
'Post' => array('id' => 1, 'title' => 'First Post'),
'Comment' => array(
array('id'=> 1, 'title' => 'First Comment'),
array('id'=> 2, 'title' => 'Second Comment')
array('id' => 1, 'title' => 'First Comment'),
array('id' => 2, 'title' => 'Second Comment')
),
'Tag' => array(
array('id'=> 1, 'title' => 'First Tag'),
array('id'=> 2, 'title' => 'Second Tag')
array('id' => 1, 'title' => 'First Tag'),
array('id' => 2, 'title' => 'Second Tag')
),
);
$map = Set::map($expected);
@ -2093,12 +2093,12 @@ class SetTest extends CakeTestCase {
$result = Set::reverse($map);
$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);
$result = Set::reverse($map);
$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->User = new stdClass;
$class->User->psword = 'whatever';
@ -2107,7 +2107,7 @@ class SetTest extends CakeTestCase {
$result = Set::reverse($class);
$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->User = new stdClass;
$class->User->psword = 'whatever';
@ -2120,8 +2120,8 @@ class SetTest extends CakeTestCase {
$result = Set::reverse($class);
$this->assertEquals($expected, $result);
$expected = array('User' => array('psword'=> 'whatever',
'Icon' => array('id'=> 851),
$expected = array('User' => array('psword' => 'whatever',
'Icon' => array('id' => 851),
'Profile' => array('name' => 'Some Name', 'address' => 'Some Address'),
'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'),
@ -2156,8 +2156,8 @@ class SetTest extends CakeTestCase {
$result = Set::reverse($class);
$this->assertEquals($expected, $result);
$expected = array('User' => array('psword'=> 'whatever',
'Icon' => array('id'=> 851),
$expected = array('User' => array('psword' => 'whatever',
'Icon' => array('id' => 851),
'Profile' => array('name' => 'Some Name', 'address' => 'Some Address'),
'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'),
@ -2200,7 +2200,7 @@ class SetTest extends CakeTestCase {
$class->Profile->name = 'Joe Mamma';
$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);
$class = new stdClass;
@ -2361,7 +2361,7 @@ class SetTest extends CakeTestCase {
),
'meta' => array(
'keywords' => array('testing','tests'),
'description'=>'describe me',
'description' => 'describe me',
),
'get_vars' => '',
'post_vars' => array(),
@ -2388,7 +2388,7 @@ class SetTest extends CakeTestCase {
),
'meta' => array(
'keywords' => array('testing','tests'),
'description'=>'describe me',
'description' => 'describe me',
),
'get_vars' => '',
'post_vars' => array(),
@ -2715,37 +2715,37 @@ class SetTest extends CakeTestCase {
* @return void
*/
public function testPushDiff() {
$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'));
$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'));
$result = Set::pushDiff($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);
$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);
$array1 = array(
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')));
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')));
$array2 = array(
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')));
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')));
$result = Set::pushDiff($array1, $array2);
$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);
$expected = array(
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')),
1 => array('ModelTwo' => array('id'=>1002, 'field_one'=>'s1.1.m2.f2', 'field_two'=>'s1.1.m2.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')),
1 => array('ModelTwo' => array('id' => 1002, 'field_one' => 's1.1.m2.f2', 'field_two' => 's1.1.m2.f2')));
$this->assertEquals($expected, $result);
$result = Set::pushDiff($array1, null);

View file

@ -867,7 +867,7 @@ class XmlTest extends CakeTestCase {
$this->assertEquals(str_replace(array("\r", "\n"), '', $obj->asXML()), $expected);
//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);
$obj = Xml::build(compact('data'));
$expected = '<' . '?xml version="1.0" encoding="UTF-8"?><data>';

View file

@ -1324,7 +1324,7 @@ class FormHelperTest extends CakeTestCase {
$this->assertEquals($this->Form->fields, array());
$result = $this->Form->file('Attachment.file');
$expected = array (
$expected = array(
'Attachment.file.name', 'Attachment.file.type', 'Attachment.file.tmp_name',
'Attachment.file.error', 'Attachment.file.size'
);
@ -2144,7 +2144,7 @@ class FormHelperTest extends CakeTestCase {
$this->assertRegExp('#<option value="15"[^>]*>15</option>#', $result[1]);
$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
));
$result = explode(':', $result);
@ -2170,8 +2170,8 @@ class FormHelperTest extends CakeTestCase {
function testInputDatetime() {
extract($this->dateRegex);
$result = $this->Form->input('prueba', array(
'type' => 'datetime', 'timeFormat'=> 24 , 'dateFormat'=>'DMY' , 'minYear' => 2008,
'maxYear' => date('Y') + 1 ,'interval' => 15
'type' => 'datetime', 'timeFormat' => 24, 'dateFormat' => 'DMY', 'minYear' => 2008,
'maxYear' => date('Y') + 1, 'interval' => 15
));
$result = explode(':', $result);
$this->assertNotRegExp('#<option value="12"[^>]*>12</option>#', $result[1]);
@ -4337,7 +4337,7 @@ class FormHelperTest extends CakeTestCase {
$this->assertTags($result, $expected);
$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(
'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'))

View file

@ -446,11 +446,11 @@ class HtmlHelperTest extends CakeTestCase {
$result = $this->Html->style('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;';
$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);
$this->assertRegExp('/^\s*display\s*:\s*none\s*;\s*$/', $lines[0]);
$this->assertRegExp('/^\s*margin\s*:\s*10px\s*;?$/', $lines[1]);
@ -1055,7 +1055,7 @@ class HtmlHelperTest extends CakeTestCase {
);
$this->assertTags($result, $expected);
$result = $this->Html->nestedList($list, array('class'=>'list'));
$result = $this->Html->nestedList($list, array('class' => 'list'));
$expected = array(
array('ul' => array('class' => 'list')),
'<li', 'Item 1', '/li',
@ -1145,7 +1145,7 @@ class HtmlHelperTest extends CakeTestCase {
);
$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(
array('ul' => array('class' => 'list')),
array('li' => array('class' => 'item')), 'Item 1', '/li',

View file

@ -112,11 +112,11 @@ class NumberHelperTest extends CakeTestCase {
$expected = '&#163;100,100,100.00';
$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€';
$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';
$this->assertEquals($expected,$result);
@ -124,7 +124,7 @@ class NumberHelperTest extends CakeTestCase {
$expected = '50c';
$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';
$this->assertEquals($expected,$result);
@ -198,7 +198,7 @@ class NumberHelperTest extends CakeTestCase {
$expected = '$100,100,100.00';
$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';
$this->assertEquals($expected, $result);
@ -239,15 +239,15 @@ class NumberHelperTest extends CakeTestCase {
$expected = '(&#163;100,100,100.00)';
$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';
$this->assertEquals($expected, $result);
$result = $this->Number->currency($value, 'EUR', array('negative'=>'-'));
$result = $this->Number->currency($value, 'EUR', array('negative' => '-'));
$expected = '-&#8364;100.100.100,00';
$this->assertEquals($expected, $result);
$result = $this->Number->currency($value, 'GBP', array('negative'=>'-'));
$result = $this->Number->currency($value, 'GBP', array('negative' => '-'));
$expected = '-&#163;100,100,100.00';
$this->assertEquals($expected, $result);
@ -294,15 +294,15 @@ class NumberHelperTest extends CakeTestCase {
$expected = '(99p)';
$this->assertEquals($expected, $result);
$result = $this->Number->currency($value, 'USD', array('negative'=>'-'));
$result = $this->Number->currency($value, 'USD', array('negative' => '-'));
$expected = '-99c';
$this->assertEquals($expected, $result);
$result = $this->Number->currency($value, 'EUR', array('negative'=>'-'));
$result = $this->Number->currency($value, 'EUR', array('negative' => '-'));
$expected = '-&#8364;0,99';
$this->assertEquals($expected, $result);
$result = $this->Number->currency($value, 'GBP', array('negative'=>'-'));
$result = $this->Number->currency($value, 'GBP', array('negative' => '-'));
$expected = '-99p';
$this->assertEquals($expected, $result);
}

View file

@ -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']['page'] = 1;
$test = array('url'=> array(
'page'=> '1',
'sort'=>'Article.title',
'direction'=>'asc',
$test = array('url' => array(
'page' => '1',
'sort' => 'Article.title',
'direction' => 'asc',
));
$this->Paginator->options($test);
@ -2152,8 +2152,8 @@ class PaginatorHelperTest extends CakeTestCase {
public function testAjaxLinkGenerationNumbers() {
$this->Paginator->Js->expectCallCount('link', 2);
$result = $this->Paginator->numbers(array(
'modulus'=> '2',
'url'=> array('controller' => 'projects', 'action' => 'sort'),
'modulus' => '2',
'url' => array('controller' => 'projects', 'action' => 'sort'),
'update' => 'list'
));
}

View file

@ -155,7 +155,7 @@ class RssHelperTest extends CakeTestCase {
'cloud' => array(
'domain' => "rpc.sys.com",
'port' => "80",
'path' =>"/RPC2",
'path' => "/RPC2",
'registerProcedure' => "myCloud.rssPleaseNotify",
'protocol' => "xml-rpc"
)
@ -175,7 +175,7 @@ class RssHelperTest extends CakeTestCase {
'cloud' => array(
'domain' => "rpc.sys.com",
'port' => "80",
'path' =>"/RPC2",
'path' => "/RPC2",
'registerProcedure' => "myCloud.rssPleaseNotify",
'protocol' => "xml-rpc"
),
@ -219,7 +219,7 @@ class RssHelperTest extends CakeTestCase {
'xmlns:atom' => 'http://www.w3.org/2005/Atom',
'href' => "http://www.example.com/rss.xml",
'rel' => "self",
'type' =>"application/rss+xml"
'type' => "application/rss+xml"
),
'content-here',
'/channel',

View file

@ -221,12 +221,12 @@ class TextHelperTest extends CakeTestCase {
$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>';
$result = $this->Text->autoLink($text, array('class'=>'link'));
$result = $this->Text->autoLink($text, array('class' => 'link'));
$this->assertEquals($expected, $result);
$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>';
$result = $this->Text->autoLink($text, array('class'=>'link', 'id'=>'MyLink'));
$result = $this->Text->autoLink($text, array('class' => 'link', 'id' => 'MyLink'));
$this->assertEquals($expected, $result);
}
@ -420,16 +420,16 @@ class TextHelperTest extends CakeTestCase {
$result = $this->Text->toList(array('Dusty', 'Lucky', 'Ned'), 'y');
$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');
$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');
$result = $this->Text->toList(array( 'name1' => 'Dusty', 'name2' => 'Lucky'));
$result = $this->Text->toList(array('name1' => 'Dusty', 'name2' => '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');
}
}

View file

@ -169,8 +169,8 @@ class TimeHelperTest extends CakeTestCase {
$relative_date .= ($relative_date ? ', -' : '-') . $seconds . ' second' . ($seconds != 1 ? 's' : '');
}
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);
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);
if ($relative_date == '0 seconds') {
$relative_date = '0 seconds ago';
}
@ -223,8 +223,8 @@ class TimeHelperTest extends CakeTestCase {
$relative_date .= ($relative_date ? ', ' : '') . $seconds . ' second' . ($seconds != 1 ? 's' : '');
}
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);
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);
if ($relative_date == '0 seconds') {
$relative_date = '0 seconds ago';
}

View file

@ -59,7 +59,7 @@ class HelperTestPost extends Model {
*
* @var array
*/
public $hasAndBelongsToMany = array('HelperTestTag'=> array('with' => 'HelperTestPostsTag'));
public $hasAndBelongsToMany = array('HelperTestTag' => array('with' => 'HelperTestPostsTag'));
}
/**

View file

@ -218,7 +218,7 @@ class ScaffoldViewTest extends CakeTestCase {
'pass' => array(),
'form' => array(),
'named' => array(),
'url' => array('url' =>'scaffold_mock'),
'url' => array('url' => 'scaffold_mock'),
'controller' => 'scaffold_mock',
'action' => 'index',
);
@ -303,7 +303,7 @@ class ScaffoldViewTest extends CakeTestCase {
'pass' => array(1),
'form' => array(),
'named' => array(),
'url' => array('url' =>'scaffold_mock'),
'url' => array('url' => 'scaffold_mock'),
'controller' => 'scaffold_mock',
'action' => 'edit',
);
@ -345,7 +345,7 @@ class ScaffoldViewTest extends CakeTestCase {
'form' => array(),
'named' => array(),
'prefix' => 'admin',
'url' => array('url' =>'admin/scaffold_mock'),
'url' => array('url' => 'admin/scaffold_mock'),
'controller' => 'scaffold_mock',
'action' => 'admin_index',
'admin' => 1,
@ -388,7 +388,7 @@ class ScaffoldViewTest extends CakeTestCase {
'form' => array(),
'named' => array(),
'prefix' => 'admin',
'url' => array('url' =>'admin/scaffold_mock/edit/1'),
'url' => array('url' => 'admin/scaffold_mock/edit/1'),
'controller' => 'scaffold_mock',
'action' => 'admin_edit',
'admin' => 1,
@ -429,7 +429,7 @@ class ScaffoldViewTest extends CakeTestCase {
'form' => array(),
'named' => array(),
'prefix' => 'member',
'url' => array('url' =>'member/scaffold_mock'),
'url' => array('url' => 'member/scaffold_mock'),
'controller' => 'scaffold_mock',
'action' => 'member_index',
'member' => 1,

View file

@ -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' => 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' => 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' => 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),

View file

@ -53,7 +53,7 @@ class AcoTwoFixture extends CakeTestFixture {
*/
public $records = array(
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' => 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),

View file

@ -56,11 +56,11 @@ class AroTwoFixture extends CakeTestFixture {
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' => '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' => 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' => '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'),
);
}

View file

@ -39,6 +39,6 @@ class ArticleFeaturedsTagsFixture extends CakeTestFixture {
public $fields = array(
'article_featured_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))
);
}

View file

@ -39,7 +39,7 @@ class ArticlesTagFixture extends CakeTestFixture {
public $fields = array(
'article_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))
);
/**

View file

@ -39,7 +39,7 @@ class BakeArticlesBakeTagFixture extends CakeTestFixture {
public $fields = array(
'bake_article_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))
);
/**

View file

@ -38,8 +38,8 @@ class BakeCommentFixture extends CakeTestFixture {
*/
public $fields = array(
'otherid' => array('type' => 'integer', 'key' => 'primary'),
'bake_article_id' => array('type' => 'integer', 'null'=>false),
'bake_user_id' => array('type' => 'integer', 'null'=>false),
'bake_article_id' => array('type' => 'integer', 'null' => false),
'bake_user_id' => array('type' => 'integer', 'null' => false),
'comment' => 'text',
'published' => array('type' => 'string', 'length' => 1, 'default' => 'N'),
'created' => 'datetime',

View file

@ -38,8 +38,8 @@ class CommentFixture extends CakeTestFixture {
*/
public $fields = array(
'id' => array('type' => 'integer', 'key' => 'primary'),
'article_id' => array('type' => 'integer', 'null'=>false),
'user_id' => array('type' => 'integer', 'null'=>false),
'article_id' => array('type' => 'integer', 'null' => false),
'user_id' => array('type' => 'integer', 'null' => false),
'comment' => 'text',
'published' => array('type' => 'string', 'length' => 1, 'default' => 'N'),
'created' => 'datetime',

View file

@ -33,7 +33,7 @@ class CounterCacheUserNonstandardPrimaryKeyFixture extends CakeTestFixture {
);
public $records = array(
array('uid' => 66, 'name' => 'Alexander','post_count' => 2),
array('uid' => 301, 'name' => 'Steven','post_count' => 1),
array('uid' => 66, 'name' => 'Alexander', 'post_count' => 2),
array('uid' => 301, 'name' => 'Steven', 'post_count' => 1),
);
}

View file

@ -37,7 +37,7 @@ class DatatypeFixture extends CakeTestFixture {
* @var 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),
'bool' => array('type' => 'boolean', 'null' => false, 'default' => false),
);

View file

@ -27,9 +27,9 @@ class GroupUpdateAllFixture extends CakeTestFixture {
public $table = 'group_update_all';
public $fields = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'name' => array('type'=>'string', 'null' => false, 'length' => 29),
'code' => array('type'=>'integer', 'null' => false, 'length' => 4),
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'name' => array('type' => 'string', 'null' => false, 'length' => 29),
'code' => array('type' => 'integer', 'null' => false, 'length' => 4),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
);
public $records = array(

View file

@ -27,10 +27,10 @@ class ProductUpdateAllFixture extends CakeTestFixture {
public $table = 'product_update_all';
public $fields = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'name' => array('type'=>'string', 'null' => false, 'length' => 29),
'groupcode' => array('type'=>'integer', 'null' => false, 'length' => 4),
'group_id' => array('type'=>'integer', 'null' => false, 'length' => 8),
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'name' => array('type' => 'string', 'null' => false, 'length' => 29),
'groupcode' => array('type' => 'integer', 'null' => false, 'length' => 4),
'group_id' => array('type' => 'integer', 'null' => false, 'length' => 8),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
);
public $records = array(

View file

@ -39,7 +39,7 @@ class StoriesTagFixture extends CakeTestFixture {
public $fields = array(
'story' => 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))
);
/**

View file

@ -38,8 +38,8 @@ class TestPluginCommentFixture extends CakeTestFixture {
*/
public $fields = array(
'id' => array('type' => 'integer', 'key' => 'primary'),
'article_id' => array('type' => 'integer', 'null'=>false),
'user_id' => array('type' => 'integer', 'null'=>false),
'article_id' => array('type' => 'integer', 'null' => false),
'user_id' => array('type' => 'integer', 'null' => false),
'comment' => 'text',
'published' => array('type' => 'string', 'length' => 1, 'default' => 'N'),
'created' => 'datetime',

View file

@ -23,13 +23,13 @@ class TestPluginAppSchema extends CakeSchema {
public $name = 'TestPluginApp';
public $test_plugin_acos = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type'=>'string', 'null' => true),
'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'alias' => array('type'=>'string', 'null' => true),
'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type' => 'string', 'null' => true),
'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'alias' => array('type' => 'string', 'null' => true),
'lft' => 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))
);
}

View file

@ -47,7 +47,7 @@ $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework
</div>
<div id="footer">
<?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/',
array('target' => '_blank', 'escape' => false)
);

View file

@ -656,7 +656,7 @@ class Folder {
chmod($to, $mode);
umask($old);
$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);
} else {
$this->_errors[] = __d('cake_dev', '%s not created', $to);

View file

@ -220,7 +220,7 @@ class Inflector {
'/Ź|Ż|Ž/' => 'Z',
'/ź|ż|ž/' => 'z',
'/Æ|Ǽ/' => 'AE',
'/ß/'=> 'ss',
'/ß/' => 'ss',
'/IJ/' => 'IJ',
'/ij/' => 'ij',
'/Œ/' => 'OE',

View file

@ -626,7 +626,7 @@ class Set {
}
}
return $tmp;
} elseif (false !== strpos($key,'{') && false !== strpos($key,'}')) {
} elseif (false !== strpos($key, '{') && false !== strpos($key, '}')) {
$pattern = substr($key, 1, -1);
foreach ($data as $j => $val) {

View file

@ -65,7 +65,7 @@ class Helper extends Object {
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')
*
* @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('#([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]*-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('#(<[^>]+)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);

View file

@ -181,7 +181,7 @@ class HtmlHelper extends AppHelper {
*
* @param string $name Text for 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
* @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

View file

@ -43,11 +43,11 @@ class NumberHelper extends AppHelper {
'zero' => 0, 'places' => 2, 'thousands' => ',', 'decimals' => '.', 'negative' => '()', 'escape' => true
),
'GBP' => array(
'wholeSymbol'=>'&#163;', 'wholePosition' => 'before', 'fractionSymbol' => 'p', 'fractionPosition' => 'after',
'wholeSymbol' => '&#163;', 'wholePosition' => 'before', 'fractionSymbol' => 'p', 'fractionPosition' => 'after',
'zero' => 0, 'places' => 2, 'thousands' => ',', 'decimals' => '.', 'negative' => '()','escape' => false
),
'EUR' => array(
'wholeSymbol'=>'&#8364;', 'wholePosition' => 'before', 'fractionSymbol' => false, 'fractionPosition' => 'after',
'wholeSymbol' => '&#8364;', 'wholePosition' => 'before', 'fractionSymbol' => false, 'fractionPosition' => 'after',
'zero' => 0, 'places' => 2, 'thousands' => '.', 'decimals' => ',', 'negative' => '()', 'escape' => false
)
);
@ -58,7 +58,7 @@ class NumberHelper extends AppHelper {
* @var 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
);
@ -140,7 +140,7 @@ class NumberHelper extends AppHelper {
$escape = true;
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);
}

View file

@ -660,7 +660,7 @@ class PaginatorHelper extends AppHelper {
);
$options += $defaults;
$params = (array)$this->params($options['model']) + array('page'=> 1);
$params = (array)$this->params($options['model']) + array('page' => 1);
unset($options['model']);
if ($params['pageCount'] <= 1) {
@ -854,7 +854,7 @@ class PaginatorHelper extends AppHelper {
$options = array_merge(
array(
'tag' => 'span',
'before'=> null,
'before' => null,
'model' => $this->defaultModel(),
'separator' => ' | ',
'ellipsis' => '...',
@ -862,7 +862,7 @@ class PaginatorHelper extends AppHelper {
),
(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']);
if ($params['pageCount'] <= 1) {

View file

@ -48,7 +48,7 @@ $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework
</div>
<div id="footer">
<?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/',
array('target' => '_blank', 'escape' => false)
);

View file

@ -40,8 +40,8 @@
foreach ($associations as $_type => $_data) {
foreach ($_data as $_alias => $_details) {
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', 'New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "</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";
$done[] = $_details['controller'];
}
}