summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/External
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-05-24 15:20:52 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-05-24 15:20:52 +0200
commit948f0740ff2c97c558435b845d4eec64cf6c7d66 (patch)
treee3b139c5135c52b46f451ad63d86850016d0fda4 /apps/files_sharing/tests/External
parent45a75c631e638ccab8934584aedad834229d10a7 (diff)
downloadnextcloud-server-948f0740ff2c97c558435b845d4eec64cf6c7d66.tar.gz
nextcloud-server-948f0740ff2c97c558435b845d4eec64cf6c7d66.zip
Remove at() matcher in files_sharing tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/files_sharing/tests/External')
-rw-r--r--apps/files_sharing/tests/External/ManagerTest.php22
1 files changed, 14 insertions, 8 deletions
diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php
index 307b630970f..0b35e08da2d 100644
--- a/apps/files_sharing/tests/External/ManagerTest.php
+++ b/apps/files_sharing/tests/External/ManagerTest.php
@@ -231,8 +231,14 @@ class ManagerTest extends TestCase {
if ($isGroup) {
$this->manager->expects($this->never())->method('tryOCMEndPoint');
} else {
- $this->manager->expects($this->at(0))->method('tryOCMEndPoint')->with('http://localhost', 'token1', '2342', 'accept')->willReturn(false);
- $this->manager->expects($this->at(1))->method('tryOCMEndPoint')->with('http://localhost', 'token3', '2342', 'decline')->willReturn(false);
+ $this->manager->expects($this->any())->method('tryOCMEndPoint')
+ ->withConsecutive(
+ ['http://localhost', 'token1', '2342', 'accept'],
+ ['http://localhost', 'token3', '2342', 'decline'],
+ )->willReturnOnConsecutiveCalls(
+ false,
+ false,
+ );
}
// Add a share for "user"
@@ -375,12 +381,12 @@ class ManagerTest extends TestCase {
->disableOriginalConstructor()->getMock();
$client2 = $this->getMockBuilder('OCP\Http\Client\IClient')
->disableOriginalConstructor()->getMock();
- $this->clientService->expects($this->at(0))
- ->method('newClient')
- ->willReturn($client1);
- $this->clientService->expects($this->at(1))
+ $this->clientService->expects($this->exactly(2))
->method('newClient')
- ->willReturn($client2);
+ ->willReturnOnConsecutiveCalls(
+ $client1,
+ $client2,
+ );
$response = $this->createMock(IResponse::class);
$response->method('getBody')
->willReturn(json_encode([
@@ -656,7 +662,7 @@ class ManagerTest extends TestCase {
$user2Shares = $manager2->getOpenShares();
$this->assertCount(2, $user2Shares);
- $this->manager->expects($this->at(0))->method('tryOCMEndPoint')->with('http://localhost', 'token1', '2342', 'decline')->willReturn([]);
+ $this->manager->expects($this->once())->method('tryOCMEndPoint')->with('http://localhost', 'token1', '2342', 'decline')->willReturn([]);
$this->manager->removeUserShares($this->uid);
$user1Shares = $this->manager->getOpenShares();