File::info() return the file size.

This commit is contained in:
Daniel Pakuschewski 2011-09-18 13:24:56 -03:00 committed by mark_story
parent 0bb9f3f99e
commit 318ea27c8d
2 changed files with 4 additions and 1 deletions

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', 'filesize' => filesize($file)
);
$this->assertEquals($expecting, $result);

View file

@ -290,6 +290,9 @@ class File {
if (!isset($this->info['filename'])) {
$this->info['filename'] = $this->name();
}
if (!isset($this->info['filesize'])) {
$this->info['filesize'] = $this->size();
}
return $this->info;
}