Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Files/ViewTest.php')
-rw-r--r--tests/lib/Files/ViewTest.php57
1 files changed, 22 insertions, 35 deletions
diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php
index 7b735720ff1..86101d79a1e 100644
--- a/tests/lib/Files/ViewTest.php
+++ b/tests/lib/Files/ViewTest.php
@@ -7,7 +7,7 @@
namespace Test\Files;
-use OC\Cache\CappedMemoryCache;
+use OCP\Cache\CappedMemoryCache;
use OC\Files\Cache\Watcher;
use OC\Files\Filesystem;
use OC\Files\Mount\MountPoint;
@@ -2643,44 +2643,31 @@ class ViewTest extends \Test\TestCase {
])
->getMock();
- $view
- ->expects($this->at(0))
- ->method('is_file')
- ->with('/new')
- ->willReturn(false);
- $view
- ->expects($this->at(1))
- ->method('file_exists')
- ->with('/new')
- ->willReturn(true);
- $view
- ->expects($this->at(2))
- ->method('is_file')
- ->with('/new/folder')
- ->willReturn(false);
- $view
- ->expects($this->at(3))
- ->method('file_exists')
- ->with('/new/folder')
- ->willReturn(false);
- $view
- ->expects($this->at(4))
- ->method('mkdir')
- ->with('/new/folder');
- $view
- ->expects($this->at(5))
+ $view->expects($this->exactly(3))
->method('is_file')
- ->with('/new/folder/structure')
+ ->withConsecutive(
+ ['/new'],
+ ['/new/folder'],
+ ['/new/folder/structure'],
+ )
->willReturn(false);
- $view
- ->expects($this->at(6))
+ $view->expects($this->exactly(3))
->method('file_exists')
- ->with('/new/folder/structure')
- ->willReturn(false);
- $view
- ->expects($this->at(7))
+ ->withConsecutive(
+ ['/new'],
+ ['/new/folder'],
+ ['/new/folder/structure'],
+ )->willReturnOnConsecutiveCalls(
+ true,
+ false,
+ false,
+ );
+ $view->expects($this->exactly(2))
->method('mkdir')
- ->with('/new/folder/structure');
+ ->withConsecutive(
+ ['/new/folder'],
+ ['/new/folder/structure'],
+ );
$this->assertTrue(self::invokePrivate($view, 'createParentDirectories', ['/new/folder/structure']));
}