getSize() public method

Get the current file size.
public getSize ( ) : string
return string
Esempio n. 1
0
 public function testWriteSaveAndDelete()
 {
     if (file_exists(__DIR__ . '/../tmp/file.txt')) {
         unlink(__DIR__ . '/../tmp/file.txt');
     }
     $f = new File(__DIR__ . '/../tmp/file.txt');
     $f->write('123')->write('456', true)->save();
     $f->setPermissions(0777);
     $this->fileExists(__DIR__ . '/../tmp/file.txt');
     $this->assertEquals('123456', $f->read());
     $this->assertEquals(6, $f->getSize());
     $this->assertEquals('text/plain', $f->getMime());
     $f->delete();
     $this->assertFalse(file_exists(__DIR__ . '/../tmp/file.txt'));
 }