diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-08-29 16:36:40 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-08-29 16:36:40 +0200 |
commit | 6f80fe6ada68cee35e714568afeb614238fbc241 (patch) | |
tree | eec7e8eb3742ec0e6b0463c290cb0cf146affca7 /tests/lib/OCS | |
parent | 791e0214556c353d9c3ac9b2c54e465588c6af67 (diff) | |
download | nextcloud-server-6f80fe6ada68cee35e714568afeb614238fbc241.tar.gz nextcloud-server-6f80fe6ada68cee35e714568afeb614238fbc241.zip |
Remove deprecated at matcher from tests/lib
Only 15 warnings left in there
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests/lib/OCS')
-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( [ |