]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix unit tests
authorMorris Jobke <hey@morrisjobke.de>
Thu, 1 Dec 2016 23:23:33 +0000 (00:23 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Sat, 29 Apr 2017 03:59:09 +0000 (00:59 -0300)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
tests/Settings/Controller/UsersControllerTest.php

index 1dd3b0c6979293ba1e7b0cecf275e5dec9b4fded..24019800490b3b92bcbe880fbe2c20e656abdff2 100644 (file)
@@ -2546,7 +2546,7 @@ class UsersControllerTest extends \Test\TestCase {
                        ->method('getUID')
                        ->will($this->returnValue('def'));
                $this->userSession
-                       ->expects($this->exactly(2))
+                       ->expects($this->exactly(1))
                        ->method('getUser')
                        ->will($this->returnValue($user));
                $this->userManager
@@ -2555,14 +2555,9 @@ class UsersControllerTest extends \Test\TestCase {
                        ->with('abc')
                        ->willReturn(null);
 
-               $subadmin = $this->createMock('\OC\SubAdmin');
-               $subadmin->expects($this->once())
-                       ->method('isUserAccessible')
-                       ->will($this->returnValue(true));
                $this->groupManager
-                       ->expects($this->once())
-                       ->method('getSubAdmin')
-                       ->willReturn($subadmin);
+                       ->expects($this->never())
+                       ->method('getSubAdmin');
 
                $expectedResponse = new DataResponse(
                        [
@@ -2762,7 +2757,7 @@ class UsersControllerTest extends \Test\TestCase {
                        ->method('getUID')
                        ->will($this->returnValue('def'));
                $this->userSession
-                       ->expects($this->exactly(2))
+                       ->expects($this->exactly(1))
                        ->method('getUser')
                        ->will($this->returnValue($user));
                $this->userManager
@@ -2771,14 +2766,9 @@ class UsersControllerTest extends \Test\TestCase {
                        ->with('abc')
                        ->willReturn(null);
 
-               $subadmin = $this->createMock('\OC\SubAdmin');
-               $subadmin->expects($this->once())
-                       ->method('isUserAccessible')
-                       ->will($this->returnValue(true));
                $this->groupManager
-                       ->expects($this->once())
-                       ->method('getSubAdmin')
-                       ->willReturn($subadmin);
+                       ->expects($this->never())
+                       ->method('getSubAdmin');
 
                $expectedResponse = new DataResponse(
                        [