diff --git a/tests/unit/e_dateTest.php b/tests/unit/e_dateTest.php index d91236888..fd1b0c2f9 100644 --- a/tests/unit/e_dateTest.php +++ b/tests/unit/e_dateTest.php @@ -11,7 +11,7 @@ class e_dateTest extends \Codeception\Test\Unit { - + /** @var e_date */ protected $dateObj; protected function _before() diff --git a/tests/unit/e_fileTest.php b/tests/unit/e_fileTest.php new file mode 100644 index 000000000..5ec380017 --- /dev/null +++ b/tests/unit/e_fileTest.php @@ -0,0 +1,213 @@ +fl = $this->make('e_file'); + } + catch (Exception $e) + { + $this->fail("Couldn't load e_file object"); + } + + } + + +/* + public function testSend() + { + + } + + public function testFile_size_encode() + { + + } + + public function testMkDir() + { + + } + + public function testGetRemoteContent() + { + + } + + public function testDelete() + { + + } + + public function testGetRemoteFile() + { + + } + + public function test_chMod() + { + + } + + public function testIsValidURL() + { + + } + + public function testGet_dirs() + { + + } + + public function testGetErrorMessage() + { + + } + + public function testCopy() + { + + } + + public function testInitCurl() + { + + } + + public function testScandir() + { + + } + + public function testGetFiletypeLimits() + { + + } + + public function testFile_size_decode() + { + + } + + public function testZip() + { + + } + + public function testSetDefaults() + { + + } + + public function testSetMode() + { + + } + + public function testUnzipArchive() + { + + } + + public function testSetFileFilter() + { + + } + + public function testGetErrorCode() + { + + } + + public function testChmod() + { + + } + + public function testSetFileInfo() + { + + }*/ + + public function testGet_file_info() + { + $path = APP_PATH."/e107_web/lib/font-awesome/4.7.0/fonts/fontawesome-webfont.svg"; + + $ret = $this->fl->get_file_info($path); + + $this->assertEquals('image/svg+xml',$ret['mime']); + + + } +/* + public function testPrepareDirectory() + { + + } + + public function testGetFileExtension() + { + + } + + public function testRmtree() + { + + } + + public function testGet_files() + { + + } + + public function testGetUserDir() + { + + } + + public function testRemoveDir() + { + + } + + public function testUnzipGithubArchive() + { + + } + + public function testGetRootFolder() + { + + } + + public function testGetUploaded() + { + + } + + public function testGitPull() + { + + } + + public function testCleanFileName() + { + + }*/ + } diff --git a/tests/unit/e_mediaTest.php b/tests/unit/e_mediaTest.php new file mode 100644 index 000000000..b917befbf --- /dev/null +++ b/tests/unit/e_mediaTest.php @@ -0,0 +1,230 @@ +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 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() + { + + }*/ + }