summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-04-15 20:05:43 +0200
committerRobin Appelman <icewind@owncloud.com>2014-04-15 20:05:43 +0200
commit295b75cca91273c7145379cc479fa84ac14c8dd1 (patch)
tree22a0600b558449d08434decb8b498c581b48ed22 /tests
parentc82adb8c5db01d6a49c4364f7eecb2931f59cfa1 (diff)
parentffab31e3ee491b89f2263ee60497526fab5f61f5 (diff)
downloadnextcloud-server-295b75cca91273c7145379cc479fa84ac14c8dd1.tar.gz
nextcloud-server-295b75cca91273c7145379cc479fa84ac14c8dd1.zip
merge master into webdav-injection
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/group/group.php2
-rw-r--r--tests/lib/group/manager.php2
-rw-r--r--tests/lib/helper.php12
-rw-r--r--tests/lib/user/manager.php2
4 files changed, 15 insertions, 3 deletions
diff --git a/tests/lib/group/group.php b/tests/lib/group/group.php
index 147532f9947..990f8ecc1d5 100644
--- a/tests/lib/group/group.php
+++ b/tests/lib/group/group.php
@@ -287,7 +287,7 @@ class Group extends \PHPUnit_Framework_TestCase {
->will($this->returnValue(array('user2')));
$backend2->expects($this->once())
->method('usersInGroup')
- ->with('group1', 'user', 1, 0)
+ ->with('group1', 'user', 2, 1)
->will($this->returnValue(array('user1')));
$users = $group->searchUsers('user', 2, 1);
diff --git a/tests/lib/group/manager.php b/tests/lib/group/manager.php
index 90f0e1b35e2..a03997c58eb 100644
--- a/tests/lib/group/manager.php
+++ b/tests/lib/group/manager.php
@@ -254,7 +254,7 @@ class Manager extends \PHPUnit_Framework_TestCase {
$backend2 = $this->getMock('\OC_Group_Database');
$backend2->expects($this->once())
->method('getGroups')
- ->with('1', 1, 0)
+ ->with('1', 2, 1)
->will($this->returnValue(array('group12')));
$backend2->expects($this->any())
->method('groupExists')
diff --git a/tests/lib/helper.php b/tests/lib/helper.php
index 0943e6bc1b9..5d319e40f02 100644
--- a/tests/lib/helper.php
+++ b/tests/lib/helper.php
@@ -71,6 +71,18 @@ class Test_Helper extends PHPUnit_Framework_TestCase {
$this->assertEquals($result, $expected);
}
+ function testGetSecureMimeType() {
+ $dir=OC::$SERVERROOT.'/tests/data';
+
+ $result = OC_Helper::getSecureMimeType('image/svg+xml');
+ $expected = 'text/plain';
+ $this->assertEquals($result, $expected);
+
+ $result = OC_Helper::getSecureMimeType('image/png');
+ $expected = 'image/png';
+ $this->assertEquals($result, $expected);
+ }
+
function testGetFileNameMimeType() {
$this->assertEquals('text/plain', OC_Helper::getFileNameMimeType('foo.txt'));
$this->assertEquals('image/png', OC_Helper::getFileNameMimeType('foo.png'));
diff --git a/tests/lib/user/manager.php b/tests/lib/user/manager.php
index ad1ac9e12f2..8ca0f94c6fa 100644
--- a/tests/lib/user/manager.php
+++ b/tests/lib/user/manager.php
@@ -210,7 +210,7 @@ class Manager extends \PHPUnit_Framework_TestCase {
$backend2 = $this->getMock('\OC_User_Dummy');
$backend2->expects($this->once())
->method('getUsers')
- ->with($this->equalTo('fo'), $this->equalTo(1), $this->equalTo(0))
+ ->with($this->equalTo('fo'), $this->equalTo(3), $this->equalTo(1))
->will($this->returnValue(array('foo3')));
$manager = new \OC\User\Manager();