summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-05-03 11:12:43 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-05-03 11:13:19 +0200
commit027297fdad5e625ab47c65fa2297100945d6e833 (patch)
tree05ce8e736009012c8e4733d3e5fa86a7eaa751b6 /application
parent2b090dbe79a52520459c7c375b050501293b578f (diff)
test \libraries\Image::type_supported
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application')
-rw-r--r--application/tests/test_libraries_image.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/application/tests/test_libraries_image.php b/application/tests/test_libraries_image.php
new file mode 100644
index 000000000..fb34d794e
--- /dev/null
+++ b/application/tests/test_libraries_image.php
@@ -0,0 +1,38 @@
+<?php
+/*
+ * Copyright 2015 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+namespace tests;
+
+class test_libraries_image extends Test {
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function init()
+ {
+ }
+
+ public function cleanup()
+ {
+ }
+
+ public function test_type_supported_normalCase()
+ {
+ $this->t->is(\libraries\Image::type_supported('image/png'), true, 'image/png should be supported');
+ $this->t->is(\libraries\Image::type_supported('image/jpeg'), true, 'image/jpeg should be supported');
+ $this->t->is(\libraries\Image::type_supported('application/pdf'), true, 'application/pdf should be supported');
+
+ $this->t->is(\libraries\Image::type_supported('application/octet-stream'), false, 'application/octet-stream should not be supported');
+ $this->t->is(\libraries\Image::type_supported('text/plain'), false, 'text/plain should not be supported');
+ }
+
+}
+