Merge remote branch 'origin/1.3' into 1.3

This commit is contained in:
predominant 2010-05-30 14:31:28 +10:00
commit 907af961c8
8 changed files with 50 additions and 10 deletions

View file

@ -18,5 +18,4 @@
// @license MIT License (http://www.opensource.org/licenses/mit-license.php)
// +--------------------------------------------------------------------------------------------+ //
////////////////////////////////////////////////////////////////////////////////////////////////////
1.3.0
1.3.1

View file

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

View file

@ -185,7 +185,6 @@ class File extends Object {
while (!feof($this->handle)) {
$data .= fgets($this->handle, 4096);
}
$data = trim($data);
if ($this->lock !== null) {
flock($this->handle, LOCK_UN);

View file

@ -451,7 +451,7 @@ class CakeSchema extends Object {
$tables = array();
foreach ($new as $table => $fields) {
if ($table == 'missing') {
break;
continue;
}
if (!array_key_exists($table, $old)) {
$tables[$table]['add'] = $fields;

View file

@ -176,7 +176,7 @@ class ModelBehavior extends Object {
case 5:
return $this->{$method}($model, $params[0], $params[1], $params[2], $params[3], $params[4]);
default:
array_unshift($params, $model);
$params = array_merge(array(&$model), $params);
return call_user_func_array(array(&$this, $method), $params);
break;
}

View file

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

View file

@ -104,6 +104,9 @@ class FileTest extends CakeTestCase {
* @return void
*/
function testRead() {
$file = __FILE__;
$this->File =& new File($file);
$result = $this->File->read();
$expecting = file_get_contents(__FILE__);
$this->assertEqual($result, $expecting);
@ -445,7 +448,7 @@ class FileTest extends CakeTestCase {
* @return void
*/
function _getTmpFile($paintSkip = true) {
$tmpFile = TMP.'tests'.DS.'cakephp.file.test.tmp';
$tmpFile = TMP . 'tests' . DS . 'cakephp.file.test.tmp';
if (is_writable(dirname($tmpFile)) && (!file_exists($tmpFile) || is_writable($tmpFile))) {
return $tmpFile;
};
@ -454,14 +457,14 @@ class FileTest extends CakeTestCase {
$caller = 'test';
if (function_exists('debug_backtrace')) {
$trace = debug_backtrace();
$caller = $trace[1]['function'].'()';
$caller = $trace[1]['function'] . '()';
}
$assertLine = new SimpleStackTrace(array(__FUNCTION__));
$assertLine = $assertLine->traceMethod();
$shortPath = substr($tmpFile, strlen(ROOT));
$message = '[FileTest] Skipping %s because "%s" not writeable!';
$message = sprintf(__($message, true), $caller, $shortPath).$assertLine;
$message = sprintf(__($message, true), $caller, $shortPath) . $assertLine;
$this->_reporter->paintSkip($message);
}
return false;

View file

@ -743,6 +743,45 @@ class CakeSchemaTest extends CakeTestCase {
),
);
$this->assertEqual($expected, $compare);
$tables = array(
'missing' => array(
'categories' => array(
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'created' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
'modified' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
'name' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 100),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
'tableParameters' => array('charset' => 'latin1', 'collate' => 'latin1_swedish_ci', 'engine' => 'MyISAM')
)
),
'ratings' => array(
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'foreign_key' => array('type' => 'integer', 'null' => false, 'default' => NULL),
'model' => array('type' => 'varchar', 'null' => false, 'default' => NULL),
'value' => array('type' => 'float', 'null' => false, 'length' => '5,2', 'default' => NULL),
'created' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
'modified' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
'tableParameters' => array('charset' => 'latin1', 'collate' => 'latin1_swedish_ci', 'engine' => 'MyISAM')
)
);
$compare = $New->compare($this->Schema, $tables);
$expected = array(
'ratings' => array(
'add' => array(
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'foreign_key' => array('type' => 'integer', 'null' => false, 'default' => NULL),
'model' => array('type' => 'varchar', 'null' => false, 'default' => NULL),
'value' => array('type' => 'float', 'null' => false, 'length' => '5,2', 'default' => NULL),
'created' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
'modified' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
'tableParameters' => array('charset' => 'latin1', 'collate' => 'latin1_swedish_ci', 'engine' => 'MyISAM')
)
)
);
$this->assertEqual($expected, $compare);
}
/**