diff options
author | Vincent Petry <vincent@nextcloud.com> | 2020-10-27 00:04:12 +0300 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2020-10-28 18:59:36 +0300 |
commit | 591cacd5194243388e7c82249a98fdc6c8dfed41 (patch) | |
tree | b69c70d380b5c72cc985d8618d82aa6776918e13 /tests | |
parent | 549d8902c6b86e80162a9fddb00fa03e66e6417b (diff) |
Make max GIF size configurable
Added app setting and capability "max-gif-size".
Added new import for @nextcloud/capabilities.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Co-authored-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/php/CapabilitiesTest.php | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/tests/php/CapabilitiesTest.php b/tests/php/CapabilitiesTest.php index b2a7f9445..0d17e752e 100644 --- a/tests/php/CapabilitiesTest.php +++ b/tests/php/CapabilitiesTest.php @@ -64,10 +64,12 @@ class CapabilitiesTest extends TestCase { $this->talkConfig->expects($this->never()) ->method('isDisabledForUser'); - $this->serverConfig->expects($this->once()) + $this->serverConfig->expects($this->any()) ->method('getAppValue') - ->with('spreed', 'has_reference_id', 'no') - ->willReturn('no'); + ->willReturnMap([ + ['spreed', 'has_reference_id', 'no', 'no'], + ['spreed', 'max-gif-size', '3145728', '200000'], + ]); $this->assertInstanceOf(IPublicCapability::class, $capabilities); $this->assertSame([ @@ -108,6 +110,9 @@ class CapabilitiesTest extends TestCase { 'conversations' => [ 'can-create' => false, ], + 'previews' => [ + 'max-gif-size' => 200000, + ], ], ], ], $capabilities->getCapabilities()); @@ -155,10 +160,12 @@ class CapabilitiesTest extends TestCase { ->with($user) ->willReturn($isNotAllowed); - $this->serverConfig->expects($this->once()) + $this->serverConfig->expects($this->any()) ->method('getAppValue') - ->with('spreed', 'has_reference_id', 'no') - ->willReturn('yes'); + ->willReturnMap([ + ['spreed', 'has_reference_id', 'no', 'yes'], + ['spreed', 'max-gif-size', '3145728', '200000'], + ]); $this->assertInstanceOf(IPublicCapability::class, $capabilities); $this->assertSame([ @@ -201,6 +208,9 @@ class CapabilitiesTest extends TestCase { 'conversations' => [ 'can-create' => $canCreate, ], + 'previews' => [ + 'max-gif-size' => 200000, + ], ], ], ], $capabilities->getCapabilities()); |