@@ -184,6 +184,8 @@ public function testGetOneBackendExists() {
184184 ->method ('userExists ' )
185185 ->with ($ this ->equalTo ('foo ' ))
186186 ->will ($ this ->returnValue (true ));
187+ $ backend ->expects ($ this ->never ())
188+ ->method ('loginName2UserName ' );
187189
188190 $ manager = new \OC \User \Manager ($ this ->config );
189191 $ manager ->registerBackend ($ backend );
@@ -207,6 +209,24 @@ public function testGetOneBackendNotExists() {
207209 $ this ->assertEquals (null , $ manager ->get ('foo ' ));
208210 }
209211
212+ public function testGetOneBackendDoNotTranslateLoginNames () {
213+ /**
214+ * @var \Test\Util\User\Dummy | \PHPUnit_Framework_MockObject_MockObject $backend
215+ */
216+ $ backend = $ this ->createMock (\Test \Util \User \Dummy::class);
217+ $ backend ->expects ($ this ->once ())
218+ ->method ('userExists ' )
219+ ->with ($ this ->equalTo ('bLeNdEr ' ))
220+ ->will ($ this ->returnValue (true ));
221+ $ backend ->expects ($ this ->never ())
222+ ->method ('loginName2UserName ' );
223+
224+ $ manager = new \OC \User \Manager ($ this ->config );
225+ $ manager ->registerBackend ($ backend );
226+
227+ $ this ->assertEquals ('bLeNdEr ' , $ manager ->get ('bLeNdEr ' )->getUID ());
228+ }
229+
210230 public function testSearchOneBackend () {
211231 /**
212232 * @var \Test\Util\User\Dummy | \PHPUnit_Framework_MockObject_MockObject $backend
@@ -216,6 +236,8 @@ public function testSearchOneBackend() {
216236 ->method ('getUsers ' )
217237 ->with ($ this ->equalTo ('fo ' ))
218238 ->will ($ this ->returnValue (array ('foo ' , 'afoo ' )));
239+ $ backend ->expects ($ this ->never ())
240+ ->method ('loginName2UserName ' );
219241
220242 $ manager = new \OC \User \Manager ($ this ->config );
221243 $ manager ->registerBackend ($ backend );
@@ -235,6 +257,8 @@ public function testSearchTwoBackendLimitOffset() {
235257 ->method ('getUsers ' )
236258 ->with ($ this ->equalTo ('fo ' ), $ this ->equalTo (3 ), $ this ->equalTo (1 ))
237259 ->will ($ this ->returnValue (array ('foo1 ' , 'foo2 ' )));
260+ $ backend1 ->expects ($ this ->never ())
261+ ->method ('loginName2UserName ' );
238262
239263 /**
240264 * @var \Test\Util\User\Dummy | \PHPUnit_Framework_MockObject_MockObject $backend2
@@ -244,6 +268,8 @@ public function testSearchTwoBackendLimitOffset() {
244268 ->method ('getUsers ' )
245269 ->with ($ this ->equalTo ('fo ' ), $ this ->equalTo (3 ), $ this ->equalTo (1 ))
246270 ->will ($ this ->returnValue (array ('foo3 ' )));
271+ $ backend2 ->expects ($ this ->never ())
272+ ->method ('loginName2UserName ' );
247273
248274 $ manager = new \OC \User \Manager ($ this ->config );
249275 $ manager ->registerBackend ($ backend1 );
@@ -316,6 +342,8 @@ public function testCreateUserSingleBackendNotExists() {
316342 ->method ('userExists ' )
317343 ->with ($ this ->equalTo ('foo ' ))
318344 ->will ($ this ->returnValue (false ));
345+ $ backend ->expects ($ this ->never ())
346+ ->method ('loginName2UserName ' );
319347
320348 $ manager = new \OC \User \Manager ($ this ->config );
321349 $ manager ->registerBackend ($ backend );
0 commit comments