fileOk = 'zip://'.PHPPRESENTATION_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.'Sample_01_Simple.pptx#ppt/media/phppowerpoint_logo1.gif'; $this->fileKoZip = 'zip://'.PHPPRESENTATION_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'fileNotExist.pptx#ppt/media/phppowerpoint_logo1.gif'; $this->fileKoFile = 'zip://'.PHPPRESENTATION_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.'Sample_01_Simple.pptx#ppt/media/filenotexists.gif'; } /** * @expectedException \Exception * @expectedExceptionMessage fileNotExist.pptx does not exist */ public function testContentsException() { $oDrawing = new ZipFile(); $oDrawing->setPath($this->fileKoZip); $oDrawing->getContents(); } public function testExtension() { $oDrawing = new ZipFile(); $oDrawing->setPath($this->fileOk); $this->assertEquals('gif', $oDrawing->getExtension()); } /** * @requires PHP 5.4 */ public function testMimeType() { $oDrawing = new ZipFile(); $oDrawing->setPath($this->fileOk); $this->assertEquals('image/gif', $oDrawing->getMimeType()); } /** * @requires PHP 5.4 */ public function testMimeTypeFunctionNotExists() { DrawingTest::$getimagesizefromstringExists = false; $oDrawing = new ZipFile(); $oDrawing->setPath($this->fileOk); $this->assertEquals('image/gif', $oDrawing->getMimeType()); } }