aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/tests')
-rw-r--r--apps/user_ldap/tests/user_ldap.php32
1 files changed, 2 insertions, 30 deletions
diff --git a/apps/user_ldap/tests/user_ldap.php b/apps/user_ldap/tests/user_ldap.php
index c89edc33fa9..d975fd56c51 100644
--- a/apps/user_ldap/tests/user_ldap.php
+++ b/apps/user_ldap/tests/user_ldap.php
@@ -550,23 +550,9 @@ class Test_User_Ldap_Direct extends \PHPUnit_Framework_TestCase {
public function testCountUsers() {
$access = $this->getAccessMock();
- $access->connection->expects($this->once())
- ->method('__get')
- ->will($this->returnCallback(function($name) {
- if($name === 'ldapLoginFilter') {
- return 'uid=%uid';
- }
- return null;
- }));
-
$access->expects($this->once())
->method('countUsers')
- ->will($this->returnCallback(function($filter, $a, $b, $c) {
- if($filter !== 'uid=*') {
- return false;
- }
- return 5;
- }));
+ ->will($this->returnValue(5));
$backend = new UserLDAP($access);
@@ -577,23 +563,9 @@ class Test_User_Ldap_Direct extends \PHPUnit_Framework_TestCase {
public function testCountUsersFailing() {
$access = $this->getAccessMock();
- $access->connection->expects($this->once())
- ->method('__get')
- ->will($this->returnCallback(function($name) {
- if($name === 'ldapLoginFilter') {
- return 'invalidFilter';
- }
- return null;
- }));
-
$access->expects($this->once())
->method('countUsers')
- ->will($this->returnCallback(function($filter, $a, $b, $c) {
- if($filter !== 'uid=*') {
- return false;
- }
- return 5;
- }));
+ ->will($this->returnValue(false));
$backend = new UserLDAP($access);