md = $this->make('e_media'); } catch (Exception $e) { $this->fail("Couldn't load e_media object"); } } public function testCheckFileExtension() { $types = array( array('path'=>'path-to-file/image.jpg', 'mime' => 'image/jpeg', 'expected'=>'path-to-file/image.jpg'), array('path'=>'path-to-file/image', 'mime' => 'image/jpeg', 'expected'=>'path-to-file/image.jpg'), array('path'=>'path-to-file/audio' , 'mime' => 'audio/mpeg', 'expected'=>'path-to-file/audio.mp3'), array('path'=>'path-to-file/audio.mp3', 'mime' => 'audio/mpeg', 'expected'=>'path-to-file/audio.mp3'), array('path'=>'path-to-file/image.svg', 'mime' => 'svg+xml', 'expected'=>'path-to-file/image.svg'), ); foreach($types as $val) { $actual = $this->md->checkFileExtension($val['path'],$val['mime']); $this->assertEquals($val['expected'],$actual); //echo ($actual)."\n"; } } public function testProcessAjaxUpload() { // @todo } /* public function testConvertImageToJpeg() { } public function testCheckDupe() { } public function testBrowserIndicators() { } public function testMediaData() { } public function testImport() { } public function testBrowserCarouselItem() { } public function testImportFile() { } public function testBrowserCarousel() { } public function testCountImages() { } public function testMediaSelect() { } public function testCreateCategory() { } public function testGetImages() { } public function testRemoveCat() { } public function testRemovePath() { } public function testCreateUserCategory() { } public function testGetFiles() { } public function testListIcons() { } public function testGetGlyphs() { } public function testImportIcons() { } public function testCreateCategories() { } public function testDeleteCategory() { } public function testResizeImage() { } public function testPreviewTag() { } public function testDetectType() { } public function testGetVideos() { } public function testSaveThumb() { } public function testGetAudios() { } public function testDebug() { } public function testGetCategories() { } public function testGetThumb() { } public function testDeleteAllCategories() { } public function testLog() { } public function testGetIcons() { } public function testGetPath() { }*/ }