diff options
author | skjnldsv <skjnldsv@protonmail.com> | 2024-07-17 16:48:47 +0200 |
---|---|---|
committer | skjnldsv <skjnldsv@protonmail.com> | 2024-07-18 20:15:39 +0200 |
commit | f28d933acc2d97021c69be79c7f2238cbaac419f (patch) | |
tree | d5fe8eceb005d3d72d236abb4bc1c29be4273d25 /apps/dav/tests/unit | |
parent | f45d6135d7f707d34017312e975137c645d202c7 (diff) | |
download | nextcloud-server-f28d933acc2d97021c69be79c7f2238cbaac419f.tar.gz nextcloud-server-f28d933acc2d97021c69be79c7f2238cbaac419f.zip |
feat(files_sharing): add public name prompt for files requests
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/dav/tests/unit')
-rw-r--r-- | apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php b/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php index 9a077e35076..7264119f8c6 100644 --- a/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php +++ b/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php @@ -7,6 +7,8 @@ namespace OCA\DAV\Tests\Files\Sharing; use OC\Files\View; use OCA\DAV\Files\Sharing\FilesDropPlugin; +use OCP\Share\IAttributes; +use OCP\Share\IShare; use Sabre\DAV\Exception\MethodNotAllowed; use Sabre\DAV\Server; use Sabre\HTTP\RequestInterface; @@ -18,6 +20,9 @@ class FilesDropPluginTest extends TestCase { /** @var View|\PHPUnit\Framework\MockObject\MockObject */ private $view; + /** @var IShare|\PHPUnit\Framework\MockObject\MockObject */ + private $share; + /** @var Server|\PHPUnit\Framework\MockObject\MockObject */ private $server; @@ -34,6 +39,7 @@ class FilesDropPluginTest extends TestCase { parent::setUp(); $this->view = $this->createMock(View::class); + $this->share = $this->createMock(IShare::class); $this->server = $this->createMock(Server::class); $this->plugin = new FilesDropPlugin(); @@ -42,6 +48,11 @@ class FilesDropPluginTest extends TestCase { $this->response->expects($this->never()) ->method($this->anything()); + + $attributes = $this->createMock(IAttributes::class); + $this->share->expects($this->any()) + ->method('getAttributes') + ->willReturn($attributes); } public function testInitialize(): void { @@ -69,6 +80,7 @@ class FilesDropPluginTest extends TestCase { public function testValid(): void { $this->plugin->enable(); $this->plugin->setView($this->view); + $this->plugin->setShare($this->share); $this->request->method('getMethod') ->willReturn('PUT'); @@ -93,6 +105,7 @@ class FilesDropPluginTest extends TestCase { public function testFileAlreadyExistsValid(): void { $this->plugin->enable(); $this->plugin->setView($this->view); + $this->plugin->setShare($this->share); $this->request->method('getMethod') ->willReturn('PUT'); @@ -122,6 +135,7 @@ class FilesDropPluginTest extends TestCase { public function testNoMKCOL(): void { $this->plugin->enable(); $this->plugin->setView($this->view); + $this->plugin->setShare($this->share); $this->request->method('getMethod') ->willReturn('MKCOL'); @@ -134,6 +148,7 @@ class FilesDropPluginTest extends TestCase { public function testNoSubdirPut(): void { $this->plugin->enable(); $this->plugin->setView($this->view); + $this->plugin->setShare($this->share); $this->request->method('getMethod') ->willReturn('PUT'); |