From 8a7bc3fb039280a61b46af5795476be062e003fe Mon Sep 17 00:00:00 2001 From: Sebastian Steinmetz Date: Sat, 11 Aug 2018 01:22:57 +0200 Subject: Testcase for HEIC image (similar to the ImageTest) Signed-off-by: Sebastian Steinmetz --- tests/lib/Preview/HEICTest.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tests/lib/Preview/HEICTest.php (limited to 'tests/lib/Preview') diff --git a/tests/lib/Preview/HEICTest.php b/tests/lib/Preview/HEICTest.php new file mode 100644 index 00000000000..324d0683953 --- /dev/null +++ b/tests/lib/Preview/HEICTest.php @@ -0,0 +1,42 @@ +. + * + */ + +namespace Test\Preview; + +/** + * Class BitmapTest + * + * @group DB + * + * @package Test\Preview + */ +class HEICTest extends Provider { + + public function setUp() { + parent::setUp(); + + $fileName = 'testimage.heic'; + $this->imgPath = $this->prepareTestFile($fileName, \OC::$SERVERROOT . '/tests/data/' . $fileName); + $this->width = 1680; + $this->height = 1050; + $this->provider = new \OC\Preview\HEIC; + } +} \ No newline at end of file -- cgit v1.2.3 From 5a996b5f879c83f0911ba33af542fdd844929b79 Mon Sep 17 00:00:00 2001 From: Sebastian Steinmetz Date: Fri, 17 Aug 2018 18:34:51 +0200 Subject: Address comments from @rullzer: - implement isAvailable - run tests only if ImageMagick with HEIC support is available in the environment Signed-off-by: Sebastian Steinmetz --- tests/lib/Preview/HEICTest.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'tests/lib/Preview') diff --git a/tests/lib/Preview/HEICTest.php b/tests/lib/Preview/HEICTest.php index 324d0683953..63b9038d35d 100644 --- a/tests/lib/Preview/HEICTest.php +++ b/tests/lib/Preview/HEICTest.php @@ -31,12 +31,18 @@ namespace Test\Preview; class HEICTest extends Provider { public function setUp() { - parent::setUp(); + if ( !in_array("HEIC", \Imagick::queryFormats("HEI*")) ) { + $this->markTestSkipped('ImageMagick is not HEIC aware. Skipping tests'); + } else { + parent::setUp(); + + $fileName = 'testimage.heic'; + $this->imgPath = $this->prepareTestFile($fileName, \OC::$SERVERROOT . '/tests/data/' . $fileName); + $this->width = 1680; + $this->height = 1050; + $this->provider = new \OC\Preview\HEIC; + } - $fileName = 'testimage.heic'; - $this->imgPath = $this->prepareTestFile($fileName, \OC::$SERVERROOT . '/tests/data/' . $fileName); - $this->width = 1680; - $this->height = 1050; - $this->provider = new \OC\Preview\HEIC; } + } \ No newline at end of file -- cgit v1.2.3