summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-03-31 10:48:38 +0200
committerArthur Schiwon <blizzz@owncloud.com>2014-06-03 12:59:09 +0200
commitb0d1b2557c4b85d2b32cfaf329e1022f4d4c65ad (patch)
tree21241c5ea2ac096ca1be76e8b75ae21736d52ab3 /apps/user_ldap/tests
parent6d64d7ec3fb64d6b2f196d4008f59b64e5a50446 (diff)
downloadnextcloud-server-b0d1b2557c4b85d2b32cfaf329e1022f4d4c65ad.tar.gz
nextcloud-server-b0d1b2557c4b85d2b32cfaf329e1022f4d4c65ad.zip
adjust Access test
Diffstat (limited to 'apps/user_ldap/tests')
-rw-r--r--apps/user_ldap/tests/access.php23
1 files changed, 16 insertions, 7 deletions
diff --git a/apps/user_ldap/tests/access.php b/apps/user_ldap/tests/access.php
index 9beb2b97336..8ead5d68482 100644
--- a/apps/user_ldap/tests/access.php
+++ b/apps/user_ldap/tests/access.php
@@ -30,30 +30,39 @@ class Test_Access extends \PHPUnit_Framework_TestCase {
private function getConnecterAndLdapMock() {
static $conMethods;
static $accMethods;
+ static $umMethods;
if(is_null($conMethods) || is_null($accMethods)) {
$conMethods = get_class_methods('\OCA\user_ldap\lib\Connection');
$accMethods = get_class_methods('\OCA\user_ldap\lib\Access');
+ $umMethods = get_class_methods('\OCA\user_ldap\lib\user\Manager');
}
$lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper');
$connector = $this->getMock('\OCA\user_ldap\lib\Connection',
$conMethods,
array($lw, null, null));
+ $um = $this->getMock('\OCA\user_ldap\lib\user\Manager',
+ $umMethods, array(
+ $this->getMock('\OCP\IConfig'),
+ $this->getMock('\OCA\user_ldap\lib\FilesystemHelper'),
+ $this->getMock('\OCA\user_ldap\lib\LogWrapper'),
+ $this->getMock('\OCP\IAvatarManager'),
+ $this->getMock('\OCP\Image')));
- return array($lw, $connector);
+ return array($lw, $connector, $um);
}
public function testEscapeFilterPartValidChars() {
- list($lw, $con) = $this->getConnecterAndLdapMock();
- $access = new Access($con, $lw);
+ list($lw, $con, $um) = $this->getConnecterAndLdapMock();
+ $access = new Access($con, $lw, $um);
$input = 'okay';
$this->assertTrue($input === $access->escapeFilterPart($input));
}
public function testEscapeFilterPartEscapeWildcard() {
- list($lw, $con) = $this->getConnecterAndLdapMock();
- $access = new Access($con, $lw);
+ list($lw, $con, $um) = $this->getConnecterAndLdapMock();
+ $access = new Access($con, $lw, $um);
$input = '*';
$expected = '\\\\*';
@@ -61,8 +70,8 @@ class Test_Access extends \PHPUnit_Framework_TestCase {
}
public function testEscapeFilterPartEscapeWildcard2() {
- list($lw, $con) = $this->getConnecterAndLdapMock();
- $access = new Access($con, $lw);
+ list($lw, $con, $um) = $this->getConnecterAndLdapMock();
+ $access = new Access($con, $lw, $um);
$input = 'foo*bar';
$expected = 'foo\\\\*bar';