aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Encryption/DecryptAllTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Encryption/DecryptAllTest.php')
-rw-r--r--tests/lib/Encryption/DecryptAllTest.php35
1 files changed, 18 insertions, 17 deletions
diff --git a/tests/lib/Encryption/DecryptAllTest.php b/tests/lib/Encryption/DecryptAllTest.php
index 90ff045a9b9..92ed2dcd701 100644
--- a/tests/lib/Encryption/DecryptAllTest.php
+++ b/tests/lib/Encryption/DecryptAllTest.php
@@ -224,12 +224,12 @@ class DecryptAllTest extends TestCase {
$this->userInterface->expects($this->any())
->method('getUsers')
->willReturn(['user1', 'user2']);
- $instance->expects($this->at(0))
+ $instance->expects($this->exactly(2))
->method('decryptUsersFiles')
- ->with('user1');
- $instance->expects($this->at(1))
- ->method('decryptUsersFiles')
- ->with('user2');
+ ->withConsecutive(
+ ['user1'],
+ ['user2'],
+ );
} else {
$instance->expects($this->once())
->method('decryptUsersFiles')
@@ -269,17 +269,18 @@ class DecryptAllTest extends TestCase {
$sharedStorage->expects($this->once())->method('instanceOfStorage')
->with('OCA\Files_Sharing\SharedStorage')->willReturn(true);
- $this->view->expects($this->at(0))->method('getDirectoryContent')
- ->with('/user1/files')->willReturn(
+ $this->view->expects($this->exactly(2))
+ ->method('getDirectoryContent')
+ ->withConsecutive(
+ ['/user1/files'],
+ ['/user1/files/foo']
+ )
+ ->willReturnOnConsecutiveCalls(
[
new FileInfo('path', $storage, 'intPath', ['name' => 'foo', 'type' => 'dir'], null),
new FileInfo('path', $storage, 'intPath', ['name' => 'bar', 'type' => 'file', 'encrypted' => true], null),
new FileInfo('path', $sharedStorage, 'intPath', ['name' => 'shared', 'type' => 'file', 'encrypted' => true], null),
- ]
- );
-
- $this->view->expects($this->at(3))->method('getDirectoryContent')
- ->with('/user1/files/foo')->willReturn(
+ ],
[
new FileInfo('path', $storage, 'intPath', ['name' => 'subfile', 'type' => 'file', 'encrypted' => true], null)
]
@@ -295,12 +296,12 @@ class DecryptAllTest extends TestCase {
}
);
- $instance->expects($this->at(0))
- ->method('decryptFile')
- ->with('/user1/files/bar');
- $instance->expects($this->at(1))
+ $instance->expects($this->exactly(2))
->method('decryptFile')
- ->with('/user1/files/foo/subfile');
+ ->withConsecutive(
+ ['/user1/files/bar'],
+ ['/user1/files/foo/subfile'],
+ );
/* We need format method to return a string */
pan class="p">, "No preview available for" => "没有预览" ); $PLURAL_FORMS = "nplurals=1; plural=0;";