summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-06-16 20:19:37 +0200
committerRobin Appelman <icewind@owncloud.com>2013-06-16 20:19:37 +0200
commitd42f7b85f3d6ec524d1144a599edf3b67e88b1a1 (patch)
tree964747acc93bd304471e04231798424123ee76ff
parent85abede9bf91b0bdbc2bbb938dc2cb5ef26fd361 (diff)
downloadnextcloud-server-d42f7b85f3d6ec524d1144a599edf3b67e88b1a1.tar.gz
nextcloud-server-d42f7b85f3d6ec524d1144a599edf3b67e88b1a1.zip
Basic tests for getFileNameMimeType
-rw-r--r--tests/lib/helper.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/lib/helper.php b/tests/lib/helper.php
index 336e8f8b3c5..6acb0dfaa6b 100644
--- a/tests/lib/helper.php
+++ b/tests/lib/helper.php
@@ -67,6 +67,15 @@ class Test_Helper extends PHPUnit_Framework_TestCase {
$this->assertEquals($result, $expected);
}
+ function testGetFileNameMimeType() {
+ $this->assertEquals('text/plain', OC_Helper::getFileNameMimeType('foo.txt'));
+ $this->assertEquals('image/png', OC_Helper::getFileNameMimeType('foo.png'));
+ $this->assertEquals('image/png', OC_Helper::getFileNameMimeType('foo.bar.png'));
+ $this->assertEquals('application/octet-stream', OC_Helper::getFileNameMimeType('.png'));
+ $this->assertEquals('application/octet-stream', OC_Helper::getFileNameMimeType('foo'));
+ $this->assertEquals('application/octet-stream', OC_Helper::getFileNameMimeType(''));
+ }
+
function testGetStringMimeType() {
$result = OC_Helper::getStringMimeType("/data/data.tar.gz");
$expected = 'text/plain; charset=us-ascii';