@@ -185,6 +185,8 @@ public function testGetOneBackendExists() {
185185 ->method ('userExists ' )
186186 ->with ($ this ->equalTo ('foo ' ))
187187 ->will ($ this ->returnValue (true ));
188+ $ backend ->expects ($ this ->never ())
189+ ->method ('loginName2UserName ' );
188190
189191 $ manager = new \OC \User \Manager ($ this ->config );
190192 $ manager ->registerBackend ($ backend );
@@ -208,6 +210,24 @@ public function testGetOneBackendNotExists() {
208210 $ this ->assertEquals (null , $ manager ->get ('foo ' ));
209211 }
210212
213+ public function testGetOneBackendDoNotTranslateLoginNames () {
214+ /**
215+ * @var \Test\Util\User\Dummy | \PHPUnit_Framework_MockObject_MockObject $backend
216+ */
217+ $ backend = $ this ->createMock (\Test \Util \User \Dummy::class);
218+ $ backend ->expects ($ this ->once ())
219+ ->method ('userExists ' )
220+ ->with ($ this ->equalTo ('bLeNdEr ' ))
221+ ->will ($ this ->returnValue (true ));
222+ $ backend ->expects ($ this ->never ())
223+ ->method ('loginName2UserName ' );
224+
225+ $ manager = new \OC \User \Manager ($ this ->config );
226+ $ manager ->registerBackend ($ backend );
227+
228+ $ this ->assertEquals ('bLeNdEr ' , $ manager ->get ('bLeNdEr ' )->getUID ());
229+ }
230+
211231 public function testSearchOneBackend () {
212232 /**
213233 * @var \Test\Util\User\Dummy | \PHPUnit_Framework_MockObject_MockObject $backend
@@ -217,6 +237,8 @@ public function testSearchOneBackend() {
217237 ->method ('getUsers ' )
218238 ->with ($ this ->equalTo ('fo ' ))
219239 ->will ($ this ->returnValue (array ('foo ' , 'afoo ' )));
240+ $ backend ->expects ($ this ->never ())
241+ ->method ('loginName2UserName ' );
220242
221243 $ manager = new \OC \User \Manager ($ this ->config );
222244 $ manager ->registerBackend ($ backend );
@@ -236,6 +258,8 @@ public function testSearchTwoBackendLimitOffset() {
236258 ->method ('getUsers ' )
237259 ->with ($ this ->equalTo ('fo ' ), $ this ->equalTo (3 ), $ this ->equalTo (1 ))
238260 ->will ($ this ->returnValue (array ('foo1 ' , 'foo2 ' )));
261+ $ backend1 ->expects ($ this ->never ())
262+ ->method ('loginName2UserName ' );
239263
240264 /**
241265 * @var \Test\Util\User\Dummy | \PHPUnit_Framework_MockObject_MockObject $backend2
@@ -245,6 +269,8 @@ public function testSearchTwoBackendLimitOffset() {
245269 ->method ('getUsers ' )
246270 ->with ($ this ->equalTo ('fo ' ), $ this ->equalTo (3 ), $ this ->equalTo (1 ))
247271 ->will ($ this ->returnValue (array ('foo3 ' )));
272+ $ backend2 ->expects ($ this ->never ())
273+ ->method ('loginName2UserName ' );
248274
249275 $ manager = new \OC \User \Manager ($ this ->config );
250276 $ manager ->registerBackend ($ backend1 );
@@ -324,6 +350,8 @@ public function testCreateUserSingleBackendNotExists() {
324350 ->method ('userExists ' )
325351 ->with ($ this ->equalTo ('foo ' ))
326352 ->will ($ this ->returnValue (false ));
353+ $ backend ->expects ($ this ->never ())
354+ ->method ('loginName2UserName ' );
327355
328356 $ manager = new \OC \User \Manager ($ this ->config );
329357 $ manager ->registerBackend ($ backend );
0 commit comments