summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/tests/Controller/UsersControllerTest.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-10-16 09:01:59 +0200
committerGitHub <noreply@github.com>2018-10-16 09:01:59 +0200
commitafaee648dd056d382adc2701dc487fc82fac49ea (patch)
treebb6c042267cd050c44b69982a8349ec9cc9c7382 /apps/provisioning_api/tests/Controller/UsersControllerTest.php
parent5aaa8a8b5815a24245da6c7a91efb2564492c13f (diff)
parentcf266ee00491bc0e70fbbb7dc9720a9e2f8c3708 (diff)
downloadnextcloud-server-afaee648dd056d382adc2701dc487fc82fac49ea.tar.gz
nextcloud-server-afaee648dd056d382adc2701dc487fc82fac49ea.zip
Merge pull request #11358 from Zulan/fix-welcome-l10n
Fix welcome l10n
Diffstat (limited to 'apps/provisioning_api/tests/Controller/UsersControllerTest.php')
-rw-r--r--apps/provisioning_api/tests/Controller/UsersControllerTest.php69
1 files changed, 3 insertions, 66 deletions
diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php
index adbdb9d8685..57283e11912 100644
--- a/apps/provisioning_api/tests/Controller/UsersControllerTest.php
+++ b/apps/provisioning_api/tests/Controller/UsersControllerTest.php
@@ -3257,35 +3257,13 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('getEmailAddress')
->will($this->returnValue('abc@example.org'));
- $this->config
- ->expects($this->at(0))
- ->method('getUserValue')
- ->with('user-id', 'core', 'lang')
- ->willReturn('es');
- $l10n = $this->getMockBuilder(IL10N::class)
- ->disableOriginalConstructor()
- ->getMock();
- $this->l10nFactory
- ->expects($this->at(0))
- ->method('languageExists')
- ->with('settings', 'es')
- ->willReturn(true);
- $this->l10nFactory
- ->expects($this->at(1))
- ->method('get')
- ->with('settings', 'es')
- ->willReturn($l10n);
$emailTemplate = $this->createMock(IEMailTemplate::class);
$this->newUserMailHelper
->expects($this->at(0))
- ->method('setL10N')
- ->willReturn($l10n);
- $this->newUserMailHelper
- ->expects($this->at(1))
->method('generateTemplate')
->willReturn($emailTemplate);
$this->newUserMailHelper
- ->expects($this->at(2))
+ ->expects($this->at(1))
->method('sendMail')
->with($targetUser, $emailTemplate);
@@ -3327,35 +3305,16 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('getEmailAddress')
->will($this->returnValue('abc@example.org'));
- $this->config
- ->expects($this->at(0))
- ->method('getUserValue')
- ->with('user-id', 'core', 'lang')
- ->willReturn('es');
$l10n = $this->getMockBuilder(IL10N::class)
->disableOriginalConstructor()
->getMock();
- $this->l10nFactory
- ->expects($this->at(0))
- ->method('languageExists')
- ->with('settings', 'es')
- ->willReturn(false);
- $this->l10nFactory
- ->expects($this->at(1))
- ->method('get')
- ->with('settings', 'en')
- ->willReturn($l10n);
$emailTemplate = $this->createMock(IEMailTemplate::class);
$this->newUserMailHelper
->expects($this->at(0))
- ->method('setL10N')
- ->willReturn($l10n);
- $this->newUserMailHelper
- ->expects($this->at(1))
->method('generateTemplate')
->willReturn($emailTemplate);
$this->newUserMailHelper
- ->expects($this->at(2))
+ ->expects($this->at(1))
->method('sendMail')
->with($targetUser, $emailTemplate);
@@ -3402,35 +3361,13 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('getEmailAddress')
->will($this->returnValue('abc@example.org'));
- $this->config
- ->expects($this->at(0))
- ->method('getUserValue')
- ->with('user-id', 'core', 'lang')
- ->willReturn('es');
- $l10n = $this->getMockBuilder(IL10N::class)
- ->disableOriginalConstructor()
- ->getMock();
- $this->l10nFactory
- ->expects($this->at(0))
- ->method('languageExists')
- ->with('settings', 'es')
- ->willReturn(true);
- $this->l10nFactory
- ->expects($this->at(1))
- ->method('get')
- ->with('settings', 'es')
- ->willReturn($l10n);
$emailTemplate = $this->createMock(IEMailTemplate::class);
$this->newUserMailHelper
->expects($this->at(0))
- ->method('setL10N')
- ->willReturn($l10n);
- $this->newUserMailHelper
- ->expects($this->at(1))
->method('generateTemplate')
->willReturn($emailTemplate);
$this->newUserMailHelper
- ->expects($this->at(2))
+ ->expects($this->at(1))
->method('sendMail')
->with($targetUser, $emailTemplate)
->willThrowException(new \Exception());