Merge branch '1.3' into merger

Conflicts:
	cake/libs/controller/components/email.php
	cake/tests/cases/console/libs/tasks/fixture.test.php
	lib/Cake/Console/Command/Task/DbConfigTask.php
This commit is contained in:
mark_story 2011-09-03 00:48:09 +01:00
commit efbeab6199
5 changed files with 29 additions and 3 deletions

View file

@ -196,8 +196,8 @@
* Will append a querystring parameter containing the time the file was modified. This is
* useful for invalidating browser caches.
*
* Set to `true` to apply timestamps, when debug = 0, or set to 'force' to always enable
* timestamping.
* Set to `true` to apply timestamps when debug > 0. Set to 'force' to always enable
* timestamping regardless of debug value.
*/
//Configure::write('Asset.timestamp', true);
/**

View file

@ -404,6 +404,9 @@ class FixtureTask extends BakeTask {
foreach ($records as $record) {
$row = array();
foreach ($record[$modelObject->alias] as $field => $value) {
if ($schema[$field]['type'] === 'boolean') {
$value = (int)(bool)$value;
}
$row[$field] = $value;
}
$out[] = $row;

View file

@ -187,6 +187,7 @@ class FixtureTaskTest extends CakeTestCase {
));
$this->assertRegExp("/'body' => 'Body \"value\"'/", $result, 'Data has bad escaping');
$this->assertRegExp("/'bool' => 1/", $result);
}
/**

View file

@ -399,7 +399,7 @@ class FileTest extends CakeTestCase {
public function testDelete() {
if (!$tmpFile = $this->_getTmpFile()) {
return false;
};
}
if (!file_exists($tmpFile)) {
touch($tmpFile);
@ -415,6 +415,24 @@ class FileTest extends CakeTestCase {
$this->assertFalse($result);
}
/**
* Windows has issues unlinking files if there are
* active filehandles open.
*
* @return void
*/
function testDeleteAfterRead() {
if (!$tmpFile = $this->_getTmpFile()) {
return false;
}
if (!file_exists($tmpFile)) {
touch($tmpFile);
}
$file =& new File($tmpFile);
$file->read();
$this->assertTrue($file->delete());
}
/**
* testCopy method
*

View file

@ -268,6 +268,10 @@ class File {
*/
public function delete() {
clearstatcache();
if (is_resource($this->handle)) {
fclose($this->handle);
$this->handle = null;
}
if ($this->exists()) {
return unlink($this->path);
}