/** * Tests File::getFileInfo */ public function testGetFileInfo() { $spl = $this->getFileInfo(); $file = new File($spl); $ret = $file->getFileInfo(); $this->assertEquals($spl, $ret, 'should be the same spl injected'); }
/** * Returns the size of the file in bytes. * * @access public * @author Jerome Bogaerts <*****@*****.**> * @return int */ public function getSize() { $returnValue = (int) 0; if (!empty($this->file) && empty($this->size)) { // collect from the file instance itself. $fileInfo = $this->file->getFileInfo(); $this->size = $fileInfo->getSize(); } $returnValue = $this->size; return (int) $returnValue; }