diff options
author | Robin Appelman <robin@icewind.nl> | 2018-12-06 13:58:57 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2018-12-06 15:10:08 +0100 |
commit | 740ea0d30e8ed8967e5d940b971e8854812c627d (patch) | |
tree | 185e1533fc353c7731f7999b7837989bbc926199 /tests | |
parent | 43cb51d374421cca2bef3008b3adad9d9668a726 (diff) | |
download | nextcloud-server-740ea0d30e8ed8967e5d940b971e8854812c627d.tar.gz nextcloud-server-740ea0d30e8ed8967e5d940b971e8854812c627d.zip |
try to grab the appdata folder directly without going trough the whole tree
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Files/AppData/AppDataTest.php | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/tests/lib/Files/AppData/AppDataTest.php b/tests/lib/Files/AppData/AppDataTest.php index 3247ce7ba99..1d5cea0faf1 100644 --- a/tests/lib/Files/AppData/AppDataTest.php +++ b/tests/lib/Files/AppData/AppDataTest.php @@ -55,30 +55,22 @@ class AppDataTest extends \Test\TestCase { } private function setupAppFolder() { - $dataFolder = $this->createMock(Folder::class); $appFolder = $this->createMock(Folder::class); - $this->rootFolder->expects($this->once()) - ->method('get') - ->with($this->equalTo('appdata_iid')) - ->willReturn($dataFolder); - $dataFolder->expects($this->once()) + $this->rootFolder->expects($this->any()) ->method('get') - ->with($this->equalTo('myApp')) + ->with($this->equalTo('appdata_iid/myApp')) ->willReturn($appFolder); - return [$dataFolder, $appFolder]; + return $appFolder; } public function testGetFolder() { - $folders = $this->setupAppFolder(); - $appFolder = $folders[1]; - $folder = $this->createMock(Folder::class); - $appFolder->expects($this->once()) + $this->rootFolder->expects($this->once()) ->method('get') - ->with($this->equalTo('folder')) + ->with($this->equalTo('appdata_iid/myApp/folder')) ->willReturn($folder); $result = $this->appData->getFolder('folder'); @@ -86,8 +78,7 @@ class AppDataTest extends \Test\TestCase { } public function testNewFolder() { - $folders = $this->setupAppFolder(); - $appFolder = $folders[1]; + $appFolder = $this->setupAppFolder(); $folder = $this->createMock(Folder::class); @@ -101,8 +92,7 @@ class AppDataTest extends \Test\TestCase { } public function testGetDirectoryListing() { - $folders = $this->setupAppFolder(); - $appFolder = $folders[1]; + $appFolder = $this->setupAppFolder(); $file = $this->createMock(File::class); $folder = $this->createMock(Folder::class); |