summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-05-28 20:59:44 +0200
committerAleksander Machniak <alec@alec.pl>2013-05-28 20:59:44 +0200
commitfe0f1d589b2320905fa3dd73737d5b7b1cbc402a (patch)
treef350019cd9446e2f1651047f2d120f12a939e9f3 /tests
parentb91bc101a0a3c8227b225ce557954f6a1e654ed3 (diff)
Improve rcube_utils::file2class() to not return duplicates
Diffstat (limited to 'tests')
-rw-r--r--tests/Framework/Utils.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/Framework/Utils.php b/tests/Framework/Utils.php
index 7c1e92ac8..65efeecff 100644
--- a/tests/Framework/Utils.php
+++ b/tests/Framework/Utils.php
@@ -229,4 +229,20 @@ class Framework_Utils extends PHPUnit_Framework_TestCase
}
}
+ /**
+ * rcube:utils::file2class()
+ */
+ function test_file2class()
+ {
+ $test = array(
+ array('', '', 'unknown'),
+ array('text', 'text', 'text'),
+ array('image/png', 'image.png', 'image png'),
+ );
+
+ foreach ($test as $v) {
+ $result = rcube_utils::file2class($v[0], $v[1]);
+ $this->assertSame($v[2], $result);
+ }
+ }
}