Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2020-10-27 00:04:12 +0300
committerVincent Petry <vincent@nextcloud.com>2020-10-28 18:59:36 +0300
commit591cacd5194243388e7c82249a98fdc6c8dfed41 (patch)
treeb69c70d380b5c72cc985d8618d82aa6776918e13 /tests
parent549d8902c6b86e80162a9fddb00fa03e66e6417b (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.php22
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());