From 7fe2c81d4b5b79e65c7658004f22458489e2f588 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 1 Aug 2016 19:00:38 +0200 Subject: Test \libraries\Exif Signed-off-by: Florian Pritz --- application/test/tests/test_libraries_exif.php | 48 ++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 application/test/tests/test_libraries_exif.php diff --git a/application/test/tests/test_libraries_exif.php b/application/test/tests/test_libraries_exif.php new file mode 100644 index 000000000..3ca821c03 --- /dev/null +++ b/application/test/tests/test_libraries_exif.php @@ -0,0 +1,48 @@ + + * + * Licensed under AGPLv3 + * (see COPYING for full license text) + * + */ + +namespace test\tests; + +class test_libraries_exif extends \test\Test { + + public function __construct() + { + parent::__construct(); + } + + public function init() + { + } + + public function cleanup() + { + } + + public function test_get_exif_jpeg() + { + $ret = \libraries\Exif::get_exif(FCPATH.'/data/tests/exif-orientation-examples/Portrait_1.jpg'); + + $this->t->is($ret['Orientation'], 1, "Get correct EXIF Orientation"); + $this->t->is($ret['FileName'], "Portrait_1.jpg", "Get correct EXIF FileName"); + } + + public function test_get_exif_invalidTypes() + { + $ret = \libraries\Exif::get_exif(FCPATH.'/data/tests/black_white.png'); + $this->t->is($ret, false, "PNG not supported"); + } + + public function test_get_exif_missingFile() + { + $ret = \libraries\Exif::get_exif(FCPATH.'/data/tests/thisFileDoesNotExist'); + $this->t->is($ret, false, "Should return false for missing file"); + } + +} + -- cgit v1.2.3-24-g4f1b