From 33396193ce8f3fb4b4be7a14f4b57a90984c8abf Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 22 Mar 2018 11:19:16 -0600 Subject: [PATCH] Add writable check for filesystem:// shares --- api/tests/Vfs/SharingTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/api/tests/Vfs/SharingTest.php b/api/tests/Vfs/SharingTest.php index 3c2edc7012..0fcfe37957 100644 --- a/api/tests/Vfs/SharingTest.php +++ b/api/tests/Vfs/SharingTest.php @@ -170,6 +170,26 @@ class SharingTest extends LoggedInTest $this->checkOneFile('/filesystem_test.txt', Sharing::READONLY); } + /** + * Test for a readonly share of a path from the filesystem + */ + public function testFilesystemWritable() + { + // Don't add to files list or it deletes the folder from filesystem + $dir = '/filesystem/'; + + // Mount filesystem directory + if(Vfs::is_dir($dir)) Vfs::remove($dir); + $this->mountFilesystem($dir); + $this->assertTrue(Vfs::is_writable($dir), "Unable to write to '$dir' as expected"); + + $this->checkDirectory($dir, Sharing::WRITABLE); + + // Test folder in filesystem already has this file in it + // It should be picked up normally, but an explicit check can't hurt + $this->checkOneFile('/filesystem_test.txt', Sharing::WRITABLE); + } + /** * Check a given directory to see that a link to it works. *