]> source.dussan.org Git - nextcloud-server.git/commitdiff
Mock client URL in new user mail tests 16884/head
authorJulius Härtl <jus@bitgrid.net>
Tue, 27 Aug 2019 08:22:54 +0000 (10:22 +0200)
committerBackportbot <backportbot-noreply@rullzer.com>
Tue, 27 Aug 2019 11:49:43 +0000 (11:49 +0000)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
tests/Settings/Mailer/NewUserMailHelperTest.php

index 5eccc5bc9f4aa1b6d5e4a3440e05b8cf62865525..9387ee61e54c92bf94039c800003637acadb2971 100644 (file)
@@ -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')