Skip to content
Snippets Groups Projects
Unverified Commit 2fde21e3 authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

extend tests for status quo

parent a8ab67ff
No related branches found
No related tags found
No related merge requests found
......@@ -185,6 +185,9 @@ class ManagerTest extends TestCase {
->method('userExists')
->with($this->equalTo('foo'))
->will($this->returnValue(true));
$backend->expects($this->once())
->method('loginName2UserName')
->willReturn(false);
$manager = new \OC\User\Manager($this->config);
$manager->registerBackend($backend);
......@@ -236,6 +239,9 @@ class ManagerTest extends TestCase {
->method('getUsers')
->with($this->equalTo('fo'), $this->equalTo(3), $this->equalTo(1))
->will($this->returnValue(array('foo1', 'foo2')));
$backend1->expects($this->exactly(2))
->method('loginName2UserName')
->willReturn(false);
/**
* @var \Test\Util\User\Dummy | \PHPUnit_Framework_MockObject_MockObject $backend2
......@@ -245,6 +251,9 @@ class ManagerTest extends TestCase {
->method('getUsers')
->with($this->equalTo('fo'), $this->equalTo(3), $this->equalTo(1))
->will($this->returnValue(array('foo3')));
$backend2->expects($this->once())
->method('loginName2UserName')
->willReturn(false);
$manager = new \OC\User\Manager($this->config);
$manager->registerBackend($backend1);
......@@ -324,6 +333,9 @@ class ManagerTest extends TestCase {
->method('userExists')
->with($this->equalTo('foo'))
->will($this->returnValue(false));
$backend->expects($this->once())
->method('loginName2UserName')
->willReturn(false);
$manager = new \OC\User\Manager($this->config);
$manager->registerBackend($backend);
......
......@@ -108,6 +108,13 @@ class Dummy extends Backend implements \OCP\IUserBackend {
return false;
}
public function loginName2UserName($loginName) {
if(isset($this->users[strtolower($loginName)])) {
return strtolower($loginName);
}
return false;
}
/**
* Get a list of all users
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment