Skip to content

Commit

Permalink
File::info() return the file size.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Pakuschewski authored and markstory committed Oct 22, 2011
1 parent 0bb9f3f commit 318ea27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Utility/FileTest.php
Expand Up @@ -74,7 +74,7 @@ public function testBasic() {
$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);

Expand Down
3 changes: 3 additions & 0 deletions lib/Cake/Utility/File.php
Expand Up @@ -290,6 +290,9 @@ public function info() {
if (!isset($this->info['filename'])) {
$this->info['filename'] = $this->name();
}
if (!isset($this->info['filesize'])) {
$this->info['filesize'] = $this->size();
}
return $this->info;
}

Expand Down

0 comments on commit 318ea27

Please sign in to comment.