From: Julius Härtl Date: Tue, 27 Aug 2019 08:22:54 +0000 (+0200) Subject: Mock client URL in new user mail tests X-Git-Tag: v16.0.5RC1~36^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=81a6adab41fd56423122e8a9e30c687a40ac0cdc;p=nextcloud-server.git Mock client URL in new user mail tests Signed-off-by: Julius Härtl --- diff --git a/tests/Settings/Mailer/NewUserMailHelperTest.php b/tests/Settings/Mailer/NewUserMailHelperTest.php index f29da7fbfde..0e7bc395f2a 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')