diff options
author | Florian Pritz <bluewind@xinu.at> | 2016-08-01 19:00:38 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2016-08-01 19:00:38 +0200 |
commit | 7fe2c81d4b5b79e65c7658004f22458489e2f588 (patch) | |
tree | b8933f6fea43a4786eb069a70df60040c2c0c2b7 /application/test/tests | |
parent | 452b6fe4e06b76d2622056b878a964262715d486 (diff) |
Test \libraries\Exif
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/test/tests')
-rw-r--r-- | application/test/tests/test_libraries_exif.php | 48 |
1 files changed, 48 insertions, 0 deletions
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 @@ +<?php +/* + * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net> + * + * 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"); + } + +} + |