diff options
Diffstat (limited to 'tests/lib/OCS/ProviderTest.php')
-rw-r--r-- | tests/lib/OCS/ProviderTest.php | 86 |
1 files changed, 33 insertions, 53 deletions
diff --git a/tests/lib/OCS/ProviderTest.php b/tests/lib/OCS/ProviderTest.php index 3a78793f91d..f66bd2eab01 100644 --- a/tests/lib/OCS/ProviderTest.php +++ b/tests/lib/OCS/ProviderTest.php @@ -41,24 +41,14 @@ class ProviderTest extends \Test\TestCase { public function testBuildProviderListWithoutAnythingEnabled() { $this->appManager - ->expects($this->at(0)) + ->expects($this->exactly(4)) ->method('isEnabledForUser') - ->with('files_sharing') - ->willReturn(false); - $this->appManager - ->expects($this->at(1)) - ->method('isEnabledForUser') - ->with('federation') - ->willReturn(false); - $this->appManager - ->expects($this->at(2)) - ->method('isEnabledForUser') - ->with('activity') - ->willReturn(false); - $this->appManager - ->expects($this->at(3)) - ->method('isEnabledForUser') - ->with('provisioning_api') + ->withConsecutive( + ['files_sharing'], + ['federation'], + ['activity'], + ['provisioning_api'] + ) ->willReturn(false); $expected = new \OCP\AppFramework\Http\JSONResponse( @@ -82,25 +72,20 @@ class ProviderTest extends \Test\TestCase { public function testBuildProviderListWithSharingEnabled() { $this->appManager - ->expects($this->at(0)) - ->method('isEnabledForUser') - ->with('files_sharing') - ->willReturn(true); - $this->appManager - ->expects($this->at(1)) - ->method('isEnabledForUser') - ->with('federation') - ->willReturn(false); - $this->appManager - ->expects($this->at(2)) + ->expects($this->exactly(4)) ->method('isEnabledForUser') - ->with('activity') - ->willReturn(false); - $this->appManager - ->expects($this->at(3)) - ->method('isEnabledForUser') - ->with('provisioning_api') - ->willReturn(false); + ->withConsecutive( + ['files_sharing'], + ['federation'], + ['activity'], + ['provisioning_api'] + ) + ->willReturnOnConsecutiveCalls( + true, + false, + false, + false + ); $expected = new \OCP\AppFramework\Http\JSONResponse( [ @@ -136,25 +121,20 @@ class ProviderTest extends \Test\TestCase { public function testBuildProviderListWithFederationEnabled() { $this->appManager - ->expects($this->at(0)) - ->method('isEnabledForUser') - ->with('files_sharing') - ->willReturn(false); - $this->appManager - ->expects($this->at(1)) + ->expects($this->exactly(4)) ->method('isEnabledForUser') - ->with('federation') - ->willReturn(true); - $this->appManager - ->expects($this->at(2)) - ->method('isEnabledForUser') - ->with('activity') - ->willReturn(false); - $this->appManager - ->expects($this->at(3)) - ->method('isEnabledForUser') - ->with('provisioning_api') - ->willReturn(false); + ->withConsecutive( + ['files_sharing'], + ['federation'], + ['activity'], + ['provisioning_api'] + ) + ->willReturnOnConsecutiveCalls( + false, + true, + false, + false + ); $expected = new \OCP\AppFramework\Http\JSONResponse( [ |