diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-08-29 15:24:58 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-08-29 15:24:58 +0200 |
commit | 9874557e439f1976949e4b190967190864c8d13e (patch) | |
tree | 24a5d5455be43b73997fc101f4d22deea19c6c20 /apps/dav | |
parent | d90b31401c412d18e29ac08f6d091d09d1fc4ce0 (diff) | |
download | nextcloud-server-9874557e439f1976949e4b190967190864c8d13e.tar.gz nextcloud-server-9874557e439f1976949e4b190967190864c8d13e.zip |
Fix Capabilities tests for dav application
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/tests/unit/CapabilitiesTest.php | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/apps/dav/tests/unit/CapabilitiesTest.php b/apps/dav/tests/unit/CapabilitiesTest.php index 7abfd08854b..6a9a0c1180a 100644 --- a/apps/dav/tests/unit/CapabilitiesTest.php +++ b/apps/dav/tests/unit/CapabilitiesTest.php @@ -24,6 +24,7 @@ namespace OCA\DAV\Tests\unit; use OCA\DAV\Capabilities; +use OCP\IConfig; use Test\TestCase; /** @@ -31,12 +32,31 @@ use Test\TestCase; */ class CapabilitiesTest extends TestCase { public function testGetCapabilities() { - $capabilities = new Capabilities(); + $config = $this->createMock(IConfig::class); + $config->expects($this->once()) + ->method('getSystemValueBool') + ->with('bulkupload.enabled', $this->isType('bool')) + ->willReturn(false); + $capabilities = new Capabilities($config); $expected = [ 'dav' => [ 'chunking' => '1.0', - // disabled because of https://github.com/nextcloud/desktop/issues/4243 - // 'bulkupload' => '1.0', + ], + ]; + $this->assertSame($expected, $capabilities->getCapabilities()); + } + + public function testGetCapabilitiesWithBulkUpload() { + $config = $this->createMock(IConfig::class); + $config->expects($this->once()) + ->method('getSystemValueBool') + ->with('bulkupload.enabled', $this->isType('bool')) + ->willReturn(true); + $capabilities = new Capabilities($config); + $expected = [ + 'dav' => [ + 'chunking' => '1.0', + 'bulkupload' => '1.0', ], ]; $this->assertSame($expected, $capabilities->getCapabilities()); |