Blame view

sources/apps/user_ldap/tests/user_ldap.php 15.6 KB
31b7f2792   Kload   Upgrade to ownclo...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  <?php
  /**
  * ownCloud
  *
  * @author Arthur Schiwon
  * @copyright 2013 Arthur Schiwon blizzz@owncloud.com
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  * License as published by the Free Software Foundation; either
  * version 3 of the License, or any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  *
  * You should have received a copy of the GNU Affero General Public
  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
  
  namespace OCA\user_ldap\tests;
  
  use \OCA\user_ldap\USER_LDAP as UserLDAP;
  use \OCA\user_ldap\lib\Access;
  use \OCA\user_ldap\lib\Connection;
  use \OCA\user_ldap\lib\ILDAPWrapper;
  
  class Test_User_Ldap_Direct extends \PHPUnit_Framework_TestCase {
  	protected $backend;
6d9380f96   Cédric Dupont   Update sources OC...
32
  	protected $access;
31b7f2792   Kload   Upgrade to ownclo...
33
34
35
36
37
38
39
40
41
  
  	public function setUp() {
  		\OC_User::clearBackends();
  		\OC_Group::clearBackends();
  	}
  
  	private function getAccessMock() {
  		static $conMethods;
  		static $accMethods;
6d9380f96   Cédric Dupont   Update sources OC...
42
  		static $uMethods;
31b7f2792   Kload   Upgrade to ownclo...
43
44
45
46
  
  		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');
6d9380f96   Cédric Dupont   Update sources OC...
47
48
49
50
51
  			unset($accMethods[array_search('getConnection', $accMethods)]);
  			$uMethods   = get_class_methods('\OCA\user_ldap\lib\user\User');
  			unset($uMethods[array_search('getUsername', $uMethods)]);
  			unset($uMethods[array_search('getDN', $uMethods)]);
  			unset($uMethods[array_search('__construct', $uMethods)]);
31b7f2792   Kload   Upgrade to ownclo...
52
53
54
55
56
  		}
  		$lw  = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper');
  		$connector = $this->getMock('\OCA\user_ldap\lib\Connection',
  									$conMethods,
  									array($lw, null, null));
6d9380f96   Cédric Dupont   Update sources OC...
57
58
59
60
61
62
63
64
  
  		$um = new \OCA\user_ldap\lib\user\Manager(
  				$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')
  			);
31b7f2792   Kload   Upgrade to ownclo...
65
66
  		$access = $this->getMock('\OCA\user_ldap\lib\Access',
  								 $accMethods,
6d9380f96   Cédric Dupont   Update sources OC...
67
68
69
  								 array($connector, $lw, $um));
  
  		$um->setLdapAccess($access);
31b7f2792   Kload   Upgrade to ownclo...
70
71
72
73
74
75
76
77
78
79
  
  		return $access;
  	}
  
  	private function prepareMockForUserExists(&$access) {
  		$access->expects($this->any())
  			   ->method('username2dn')
  			   ->will($this->returnCallback(function($uid) {
  					switch ($uid) {
  						case 'gunslinger':
6d9380f96   Cédric Dupont   Update sources OC...
80
  							return 'dnOfRoland,dc=test';
31b7f2792   Kload   Upgrade to ownclo...
81
82
  							break;
  						case 'formerUser':
6d9380f96   Cédric Dupont   Update sources OC...
83
  							return 'dnOfFormerUser,dc=test';
31b7f2792   Kload   Upgrade to ownclo...
84
85
  							break;
  						case 'newyorker':
6d9380f96   Cédric Dupont   Update sources OC...
86
  							return 'dnOfNewYorker,dc=test';
31b7f2792   Kload   Upgrade to ownclo...
87
88
  							break;
  						case 'ladyofshadows':
6d9380f96   Cédric Dupont   Update sources OC...
89
  							return 'dnOfLadyOfShadows,dc=test';
31b7f2792   Kload   Upgrade to ownclo...
90
  							break;
6d9380f96   Cédric Dupont   Update sources OC...
91
  						default:
31b7f2792   Kload   Upgrade to ownclo...
92
93
94
95
96
97
  							return false;
  					}
  			   }));
  	}
  
  	/**
6d9380f96   Cédric Dupont   Update sources OC...
98
99
  	 * Prepares the Access mock for checkPassword tests
  	 * @param \OCA\user_ldap\lib\Access $access mock
31b7f2792   Kload   Upgrade to ownclo...
100
101
102
  	 * @return void
  	 */
  	private function prepareAccessForCheckPassword(&$access) {
a293d369c   Kload   Update sources to...
103
104
105
106
107
  		$access->expects($this->once())
  			   ->method('escapeFilterPart')
  			   ->will($this->returnCallback(function($uid) {
  				   return $uid;
  			   }));
31b7f2792   Kload   Upgrade to ownclo...
108
109
110
111
112
113
114
115
116
117
118
119
120
  		$access->connection->expects($this->any())
  			   ->method('__get')
  			   ->will($this->returnCallback(function($name) {
  					if($name === 'ldapLoginFilter') {
  						return '%uid';
  					}
  					return null;
  			   }));
  
  		$access->expects($this->any())
  			   ->method('fetchListOfUsers')
  			   ->will($this->returnCallback(function($filter) {
  					if($filter === 'roland') {
6d9380f96   Cédric Dupont   Update sources OC...
121
  						return array('dnOfRoland,dc=test');
31b7f2792   Kload   Upgrade to ownclo...
122
123
124
125
126
127
  					}
  					return array();
  			   }));
  
  		$access->expects($this->any())
  			   ->method('dn2username')
6d9380f96   Cédric Dupont   Update sources OC...
128
  			   ->with($this->equalTo('dnOfRoland,dc=test'))
31b7f2792   Kload   Upgrade to ownclo...
129
130
131
132
133
134
135
136
137
138
139
  			   ->will($this->returnValue('gunslinger'));
  
  		$access->expects($this->any())
  			   ->method('areCredentialsValid')
  			   ->will($this->returnCallback(function($dn, $pwd) {
  					if($pwd === 'dt19') {
  						return true;
  					}
  					return false;
  			   }));
  	}
a293d369c   Kload   Update sources to...
140
  	public function testCheckPasswordUidReturn() {
31b7f2792   Kload   Upgrade to ownclo...
141
  		$access = $this->getAccessMock();
a293d369c   Kload   Update sources to...
142

31b7f2792   Kload   Upgrade to ownclo...
143
144
145
146
147
148
  		$this->prepareAccessForCheckPassword($access);
  		$backend = new UserLDAP($access);
  		\OC_User::useBackend($backend);
  
  		$result = $backend->checkPassword('roland', 'dt19');
  		$this->assertEquals('gunslinger', $result);
a293d369c   Kload   Update sources to...
149
150
151
152
153
154
155
156
  	}
  
  	public function testCheckPasswordWrongPassword() {
  		$access = $this->getAccessMock();
  
  		$this->prepareAccessForCheckPassword($access);
  		$backend = new UserLDAP($access);
  		\OC_User::useBackend($backend);
31b7f2792   Kload   Upgrade to ownclo...
157
158
159
  
  		$result = $backend->checkPassword('roland', 'wrong');
  		$this->assertFalse($result);
a293d369c   Kload   Update sources to...
160
161
162
163
164
165
166
167
  	}
  
  	public function testCheckPasswordWrongUser() {
  		$access = $this->getAccessMock();
  
  		$this->prepareAccessForCheckPassword($access);
  		$backend = new UserLDAP($access);
  		\OC_User::useBackend($backend);
31b7f2792   Kload   Upgrade to ownclo...
168
169
170
171
172
173
174
175
176
177
178
179
180
  
  		$result = $backend->checkPassword('mallory', 'evil');
  		$this->assertFalse($result);
  	}
  
  	public function testCheckPasswordPublicAPI() {
  		$access = $this->getAccessMock();
  		$this->prepareAccessForCheckPassword($access);
  		$backend = new UserLDAP($access);
  		\OC_User::useBackend($backend);
  
  		$result = \OCP\User::checkPassword('roland', 'dt19');
  		$this->assertEquals('gunslinger', $result);
a293d369c   Kload   Update sources to...
181
182
183
184
185
186
187
  	}
  
  	public function testCheckPasswordPublicAPIWrongPassword() {
  		$access = $this->getAccessMock();
  		$this->prepareAccessForCheckPassword($access);
  		$backend = new UserLDAP($access);
  		\OC_User::useBackend($backend);
31b7f2792   Kload   Upgrade to ownclo...
188
189
190
  
  		$result = \OCP\User::checkPassword('roland', 'wrong');
  		$this->assertFalse($result);
a293d369c   Kload   Update sources to...
191
192
193
194
195
196
197
  	}
  
  	public function testCheckPasswordPublicAPIWrongUser() {
  		$access = $this->getAccessMock();
  		$this->prepareAccessForCheckPassword($access);
  		$backend = new UserLDAP($access);
  		\OC_User::useBackend($backend);
31b7f2792   Kload   Upgrade to ownclo...
198
199
200
201
202
203
  
  		$result = \OCP\User::checkPassword('mallory', 'evil');
  		$this->assertFalse($result);
  	}
  
  	/**
6d9380f96   Cédric Dupont   Update sources OC...
204
205
  	 * Prepares the Access mock for getUsers tests
  	 * @param \OCA\user_ldap\lib\Access $access mock
31b7f2792   Kload   Upgrade to ownclo...
206
207
208
  	 * @return void
  	 */
  	private function prepareAccessForGetUsers(&$access) {
a293d369c   Kload   Update sources to...
209
210
211
212
213
  		$access->expects($this->once())
  			   ->method('escapeFilterPart')
  			   ->will($this->returnCallback(function($search) {
  				   return $search;
  			   }));
31b7f2792   Kload   Upgrade to ownclo...
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
  		$access->expects($this->any())
  			   ->method('getFilterPartForUserSearch')
  			   ->will($this->returnCallback(function($search) {
  					return $search;
  			   }));
  
  		$access->expects($this->any())
  			   ->method('combineFilterWithAnd')
  			   ->will($this->returnCallback(function($param) {
  					return $param[1];
  			   }));
  
  		$access->expects($this->any())
  			   ->method('fetchListOfUsers')
  			   ->will($this->returnCallback(function($search, $a, $l, $o) {
  					$users = array('gunslinger', 'newyorker', 'ladyofshadows');
  					if(empty($search)) {
  						$result = $users;
  					} else {
  						$result = array();
  						foreach($users as $user) {
  							if(stripos($user,  $search) !== false) {
  								$result[] = $user;
  							}
  						}
  					}
  					if(!is_null($l) || !is_null($o)) {
  						$result = array_slice($result, $o, $l);
  					}
  					return $result;
  			   }));
  
  		$access->expects($this->any())
  			   ->method('ownCloudUserNames')
  			   ->will($this->returnArgument(0));
  	}
a293d369c   Kload   Update sources to...
250
  	public function testGetUsersNoParam() {
31b7f2792   Kload   Upgrade to ownclo...
251
252
253
254
255
256
  		$access = $this->getAccessMock();
  		$this->prepareAccessForGetUsers($access);
  		$backend = new UserLDAP($access);
  
  		$result = $backend->getUsers();
  		$this->assertEquals(3, count($result));
a293d369c   Kload   Update sources to...
257
258
259
260
261
262
  	}
  
  	public function testGetUsersLimitOffset() {
  		$access = $this->getAccessMock();
  		$this->prepareAccessForGetUsers($access);
  		$backend = new UserLDAP($access);
31b7f2792   Kload   Upgrade to ownclo...
263
264
265
  
  		$result = $backend->getUsers('', 1, 2);
  		$this->assertEquals(1, count($result));
a293d369c   Kload   Update sources to...
266
267
268
269
270
271
  	}
  
  	public function testGetUsersLimitOffset2() {
  		$access = $this->getAccessMock();
  		$this->prepareAccessForGetUsers($access);
  		$backend = new UserLDAP($access);
31b7f2792   Kload   Upgrade to ownclo...
272
273
274
  
  		$result = $backend->getUsers('', 2, 1);
  		$this->assertEquals(2, count($result));
a293d369c   Kload   Update sources to...
275
276
277
278
279
280
  	}
  
  	public function testGetUsersSearchWithResult() {
  		$access = $this->getAccessMock();
  		$this->prepareAccessForGetUsers($access);
  		$backend = new UserLDAP($access);
31b7f2792   Kload   Upgrade to ownclo...
281
282
283
  
  		$result = $backend->getUsers('yo');
  		$this->assertEquals(2, count($result));
a293d369c   Kload   Update sources to...
284
285
286
287
288
289
  	}
  
  	public function testGetUsersSearchEmptyResult() {
  		$access = $this->getAccessMock();
  		$this->prepareAccessForGetUsers($access);
  		$backend = new UserLDAP($access);
31b7f2792   Kload   Upgrade to ownclo...
290
291
292
293
  
  		$result = $backend->getUsers('nix');
  		$this->assertEquals(0, count($result));
  	}
a293d369c   Kload   Update sources to...
294
  	public function testGetUsersViaAPINoParam() {
31b7f2792   Kload   Upgrade to ownclo...
295
296
297
298
299
300
301
  		$access = $this->getAccessMock();
  		$this->prepareAccessForGetUsers($access);
  		$backend = new UserLDAP($access);
  		\OC_User::useBackend($backend);
  
  		$result = \OCP\User::getUsers();
  		$this->assertEquals(3, count($result));
a293d369c   Kload   Update sources to...
302
303
304
305
306
307
308
  	}
  
  	public function testGetUsersViaAPILimitOffset() {
  		$access = $this->getAccessMock();
  		$this->prepareAccessForGetUsers($access);
  		$backend = new UserLDAP($access);
  		\OC_User::useBackend($backend);
31b7f2792   Kload   Upgrade to ownclo...
309
310
311
  
  		$result = \OCP\User::getUsers('', 1, 2);
  		$this->assertEquals(1, count($result));
a293d369c   Kload   Update sources to...
312
313
314
315
316
317
318
  	}
  
  	public function testGetUsersViaAPILimitOffset2() {
  		$access = $this->getAccessMock();
  		$this->prepareAccessForGetUsers($access);
  		$backend = new UserLDAP($access);
  		\OC_User::useBackend($backend);
31b7f2792   Kload   Upgrade to ownclo...
319
320
321
  
  		$result = \OCP\User::getUsers('', 2, 1);
  		$this->assertEquals(2, count($result));
a293d369c   Kload   Update sources to...
322
323
324
325
326
327
328
  	}
  
  	public function testGetUsersViaAPISearchWithResult() {
  		$access = $this->getAccessMock();
  		$this->prepareAccessForGetUsers($access);
  		$backend = new UserLDAP($access);
  		\OC_User::useBackend($backend);
31b7f2792   Kload   Upgrade to ownclo...
329
330
331
  
  		$result = \OCP\User::getUsers('yo');
  		$this->assertEquals(2, count($result));
a293d369c   Kload   Update sources to...
332
333
334
335
336
337
338
  	}
  
  	public function testGetUsersViaAPISearchEmptyResult() {
  		$access = $this->getAccessMock();
  		$this->prepareAccessForGetUsers($access);
  		$backend = new UserLDAP($access);
  		\OC_User::useBackend($backend);
31b7f2792   Kload   Upgrade to ownclo...
339
340
341
342
343
344
345
346
347
348
349
350
351
  
  		$result = \OCP\User::getUsers('nix');
  		$this->assertEquals(0, count($result));
  	}
  
  	public function testUserExists() {
  		$access = $this->getAccessMock();
  		$backend = new UserLDAP($access);
  		$this->prepareMockForUserExists($access);
  
  		$access->expects($this->any())
  			   ->method('readAttribute')
  			   ->will($this->returnCallback(function($dn) {
6d9380f96   Cédric Dupont   Update sources OC...
352
  					if($dn === 'dnOfRoland,dc=test') {
31b7f2792   Kload   Upgrade to ownclo...
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
  						return array();
  					}
  					return false;
  			   }));
  
  		//test for existing user
  		$result = $backend->userExists('gunslinger');
  		$this->assertTrue($result);
  
  		//test for deleted user
  		$result = $backend->userExists('formerUser');
  		$this->assertFalse($result);
  
  		//test for never-existing user
  		$result = $backend->userExists('mallory');
  		$this->assertFalse($result);
  	}
  
  	public function testUserExistsPublicAPI() {
  		$access = $this->getAccessMock();
  		$backend = new UserLDAP($access);
  		$this->prepareMockForUserExists($access);
  		\OC_User::useBackend($backend);
  
  		$access->expects($this->any())
  			   ->method('readAttribute')
  			   ->will($this->returnCallback(function($dn) {
6d9380f96   Cédric Dupont   Update sources OC...
380
  					if($dn === 'dnOfRoland,dc=test') {
31b7f2792   Kload   Upgrade to ownclo...
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
  						return array();
  					}
  					return false;
  			   }));
  
  		//test for existing user
  		$result = \OCP\User::userExists('gunslinger');
  		$this->assertTrue($result);
  
  		//test for deleted user
  		$result = \OCP\User::userExists('formerUser');
  		$this->assertFalse($result);
  
  		//test for never-existing user
  		$result = \OCP\User::userExists('mallory');
  		$this->assertFalse($result);
  	}
  
  	public function testDeleteUser() {
  		$access = $this->getAccessMock();
  		$backend = new UserLDAP($access);
  
  		//we do not support deleting users at all
  		$result = $backend->deleteUser('gunslinger');
  		$this->assertFalse($result);
  	}
  
  	public function testGetHome() {
  		$access = $this->getAccessMock();
  		$backend = new UserLDAP($access);
  		$this->prepareMockForUserExists($access);
  
  		$access->connection->expects($this->any())
  			   ->method('__get')
  			   ->will($this->returnCallback(function($name) {
  					if($name === 'homeFolderNamingRule') {
  						return 'attr:testAttribute';
  					}
  					return null;
  			   }));
  
  		$access->expects($this->any())
  			   ->method('readAttribute')
  			   ->will($this->returnCallback(function($dn, $attr) {
  					switch ($dn) {
6d9380f96   Cédric Dupont   Update sources OC...
426
  						case 'dnOfRoland,dc=test':
31b7f2792   Kload   Upgrade to ownclo...
427
428
429
430
431
  							if($attr === 'testAttribute') {
  								return array('/tmp/rolandshome/');
  							}
  							return array();
  							break;
6d9380f96   Cédric Dupont   Update sources OC...
432
  						case 'dnOfLadyOfShadows,dc=test':
31b7f2792   Kload   Upgrade to ownclo...
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
  							if($attr === 'testAttribute') {
  								return array('susannah/');
  							}
  							return array();
  							break;
  						default:
  							return false;
  				   }
  			   }));
  
  		//absolut path
  		$result = $backend->getHome('gunslinger');
  		$this->assertEquals('/tmp/rolandshome/', $result);
  
  		//datadir-relativ path
  		$result = $backend->getHome('ladyofshadows');
  		$datadir = \OCP\Config::getSystemValue('datadirectory',
  											   \OC::$SERVERROOT.'/data');
  		$this->assertEquals($datadir.'/susannah/', $result);
  
  		//no path at all – triggers OC default behaviour
  		$result = $backend->getHome('newyorker');
  		$this->assertFalse($result);
  	}
  
  	private function prepareAccessForGetDisplayName(&$access) {
  		$access->connection->expects($this->any())
  			   ->method('__get')
  			   ->will($this->returnCallback(function($name) {
  					if($name === 'ldapUserDisplayName') {
  						return 'displayname';
  					}
  					return null;
  			   }));
  
  		$access->expects($this->any())
  			   ->method('readAttribute')
  			   ->will($this->returnCallback(function($dn, $attr) {
  					switch ($dn) {
6d9380f96   Cédric Dupont   Update sources OC...
472
  						case 'dnOfRoland,dc=test':
31b7f2792   Kload   Upgrade to ownclo...
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
  							if($attr === 'displayname') {
  								return array('Roland Deschain');
  							}
  							return array();
  							break;
  
  						default:
  							return false;
  				   }
  			   }));
  	}
  
  	public function testGetDisplayName() {
  		$access = $this->getAccessMock();
  		$this->prepareAccessForGetDisplayName($access);
  		$backend = new UserLDAP($access);
  		$this->prepareMockForUserExists($access);
  
  		//with displayName
  		$result = $backend->getDisplayName('gunslinger');
  		$this->assertEquals('Roland Deschain', $result);
  
  		//empty displayname retrieved
  		$result = $backend->getDisplayName('newyorker');
  		$this->assertEquals(null, $result);
  	}
  
  	public function testGetDisplayNamePublicAPI() {
  		$access = $this->getAccessMock();
  		$this->prepareAccessForGetDisplayName($access);
  		$backend = new UserLDAP($access);
  		$this->prepareMockForUserExists($access);
  		\OC_User::useBackend($backend);
  
  		//with displayName
  		$result = \OCP\User::getDisplayName('gunslinger');
  		$this->assertEquals('Roland Deschain', $result);
  
  		//empty displayname retrieved
  		$result = \OCP\User::getDisplayName('newyorker');
  		$this->assertEquals('newyorker', $result);
  	}
  
  	//no test for getDisplayNames, because it just invokes getUsers and
  	//getDisplayName
a293d369c   Kload   Update sources to...
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
  
  	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;
  			   }));
  
  		$backend = new UserLDAP($access);
  
  		$result = $backend->countUsers();
  		$this->assertEquals(5, $result);
  	}
  
  	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;
  			   }));
  
  		$backend = new UserLDAP($access);
  
  		$result = $backend->countUsers();
  		$this->assertFalse($result);
  	}
6d9380f96   Cédric Dupont   Update sources OC...
572
  }