summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-08-27 10:22:54 +0200
committerBackportbot <backportbot-noreply@rullzer.com>2019-08-27 11:49:43 +0000
commit0ae9053c5289d19828e430b643f441fef6f83fd4 (patch)
tree96a41b8638ba39f944ab3dc93c1940b9dd8c4c91 /tests
parent62051328da503adc8580571453ef2c0306cbfaf8 (diff)
downloadnextcloud-server-0ae9053c5289d19828e430b643f441fef6f83fd4.tar.gz
nextcloud-server-0ae9053c5289d19828e430b643f441fef6f83fd4.zip
Mock client URL in new user mail tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/Settings/Mailer/NewUserMailHelperTest.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/Settings/Mailer/NewUserMailHelperTest.php b/tests/Settings/Mailer/NewUserMailHelperTest.php
index 5eccc5bc9f4..9387ee61e54 100644
--- a/tests/Settings/Mailer/NewUserMailHelperTest.php
+++ b/tests/Settings/Mailer/NewUserMailHelperTest.php
@@ -79,6 +79,18 @@ class NewUserMailHelperTest extends TestCase {
$this->secureRandom = $this->createMock(ISecureRandom::class);
$this->timeFactory = $this->createMock(ITimeFactory::class);
$this->config = $this->createMock(IConfig::class);
+ $this->config
+ ->expects($this->any())
+ ->method('getSystemValue')
+ ->willReturnCallback(function($arg) {
+ switch ($arg) {
+ case 'secret':
+ return 'MyInstanceWideSecret';
+ case 'customclient_desktop':
+ return 'https://nextcloud.com/install/#install-clients';
+ }
+ return '';
+ });
$this->crypto = $this->createMock(ICrypto::class);
$this->l10n->method('t')
->will($this->returnCallback(function ($text, $parameters = []) {
@@ -122,11 +134,6 @@ class NewUserMailHelperTest extends TestCase {
->expects($this->any())
->method('getEmailAddress')
->willReturn('recipient@example.com');
- $this->config
- ->expects($this->any())
- ->method('getSystemValue')
- ->with('secret')
- ->willReturn('MyInstanceWideSecret');
$this->crypto
->expects($this->once())
->method('encrypt')