aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2022-10-14 12:19:31 +0200
committerVincent Petry <vincent@nextcloud.com>2022-10-14 16:18:40 +0200
commitd77e8322239754ef68f9dfe8c3687a39f94cc881 (patch)
treebfec4e1003e0fe5fc77298094e36d246898b78d5 /tests
parentac21c631a61fbc7042c787a5feb0cb9aa489af91 (diff)
downloadnextcloud-server-d77e8322239754ef68f9dfe8c3687a39f94cc881.tar.gz
nextcloud-server-d77e8322239754ef68f9dfe8c3687a39f94cc881.zip
Fix tests
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/SimpleFS/SimpleFolderTest.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lib/Files/SimpleFS/SimpleFolderTest.php b/tests/lib/Files/SimpleFS/SimpleFolderTest.php
index 50714b8356e..9710b6f438b 100644
--- a/tests/lib/Files/SimpleFS/SimpleFolderTest.php
+++ b/tests/lib/Files/SimpleFS/SimpleFolderTest.php
@@ -28,6 +28,7 @@ use OC\Files\Storage\Temporary;
use OCP\Files\Folder;
use OCP\Files\NotFoundException;
use OCP\Files\SimpleFS\ISimpleFile;
+use OCP\Files\SimpleFS\ISimpleFolder;
use Test\Traits\MountProviderTrait;
use Test\Traits\UserTrait;
@@ -109,4 +110,22 @@ class SimpleFolderTest extends \Test\TestCase {
$this->assertInstanceOf(ISimpleFile::class, $result[0]);
$this->assertInstanceOf(ISimpleFile::class, $result[1]);
}
+
+ public function testGetFolder() {
+ $this->folder->newFolder('exists');
+
+ $result = $this->simpleFolder->getFolder('exists');
+ $this->assertInstanceOf(ISimpleFolder::class, $result);
+
+ $this->expectException(NotFoundException::class);
+ $this->simpleFolder->getFolder('not-exists');
+ }
+
+ public function testNewFolder() {
+ $result = $this->simpleFolder->newFolder('folder');
+ $this->assertInstanceOf(ISimpleFolder::class, $result);
+ $result->newFile('file');
+
+ $this->assertTrue($this->folder->nodeExists('folder'));
+ }
}