public function getExtension() { list($data, ) = explode(';', $this->getData()); list(, $mime) = explode(':', $data); if (!array_key_exists($mime, $this->arrayMimeExtension)) { throw new \Exception('Type Mime not found : "' . $mime . '"'); } return $this->arrayMimeExtension[$mime]; }
/** * @expectedException \Exception * @expectedExceptionMessage Type Mime not found : "fake/fake" */ public function testExtensionException() { $imgData = str_replace('image/jpeg', 'fake/fake', $this->imageData); $oDrawing = new Base64(); $oDrawing->setData($imgData); $oDrawing->getExtension(); }