public function getContents() { if (!CommonFile::fileExists($this->getZipFileOut())) { throw new \Exception('File ' . $this->getZipFileOut() . ' does not exist'); } $imageZip = new \ZipArchive(); $imageZip->open($this->getZipFileOut()); $imageContents = $imageZip->getFromName($this->getZipFileIn()); $imageZip->close(); unset($imageZip); return $imageContents; }
/** * @expectedException \Exception * @expectedExceptionMessage fileNotExist.pptx does not exist */ public function testContentsException() { $oDrawing = new ZipFile(); $oDrawing->setPath($this->fileKoZip); $oDrawing->getContents(); }