Permalink
Browse files

File::info() return the file size.

  • Loading branch information...
Daniel Pakuschewski authored and markstory committed Sep 18, 2011
1 parent 0bb9f3f commit 318ea27c8d570397de5922ea015d7a928deee148
Showing with 4 additions and 1 deletion.
  1. +1 −1 lib/Cake/Test/Case/Utility/FileTest.php
  2. +3 −0 lib/Cake/Utility/File.php
@@ -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);
@@ -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;
}

0 comments on commit 318ea27

Please sign in to comment.