summaryrefslogtreecommitdiffstats
path: root/apps/settings/tests/Settings/Admin
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-06-07 10:05:18 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-06-07 10:05:18 +0200
commitc0c54b20d95fac9ca4672403157c16ca232e36a8 (patch)
treeca012a6d2ff5c826ea8e49977c0fd69d7a94791a /apps/settings/tests/Settings/Admin
parent407ba4a8bfc264cc4dcffe3196d901415853c7e5 (diff)
downloadnextcloud-server-c0c54b20d95fac9ca4672403157c16ca232e36a8.tar.gz
nextcloud-server-c0c54b20d95fac9ca4672403157c16ca232e36a8.zip
Remove deprecated at() matcher from settings tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/settings/tests/Settings/Admin')
-rw-r--r--apps/settings/tests/Settings/Admin/MailTest.php67
-rw-r--r--apps/settings/tests/Settings/Admin/ServerTest.php19
2 files changed, 20 insertions, 66 deletions
diff --git a/apps/settings/tests/Settings/Admin/MailTest.php b/apps/settings/tests/Settings/Admin/MailTest.php
index 5fd3f1600c5..7a70065ff50 100644
--- a/apps/settings/tests/Settings/Admin/MailTest.php
+++ b/apps/settings/tests/Settings/Admin/MailTest.php
@@ -55,60 +55,21 @@ class MailTest extends TestCase {
public function testGetForm() {
$this->config
- ->expects($this->at(0))
+ ->expects($this->any())
->method('getSystemValue')
- ->with('mail_domain', '')
- ->willReturn('mx.nextcloud.com');
- $this->config
- ->expects($this->at(1))
- ->method('getSystemValue')
- ->with('mail_from_address', '')
- ->willReturn('no-reply@nextcloud.com');
- $this->config
- ->expects($this->at(2))
- ->method('getSystemValue')
- ->with('mail_smtpmode', '')
- ->willReturn('smtp');
- $this->config
- ->expects($this->at(3))
- ->method('getSystemValue')
- ->with('mail_smtpsecure', '')
- ->willReturn(true);
- $this->config
- ->expects($this->at(4))
- ->method('getSystemValue')
- ->with('mail_smtphost', '')
- ->willReturn('smtp.nextcloud.com');
- $this->config
- ->expects($this->at(5))
- ->method('getSystemValue')
- ->with('mail_smtpport', '')
- ->willReturn(25);
- $this->config
- ->expects($this->at(6))
- ->method('getSystemValue')
- ->with('mail_smtpauthtype', '')
- ->willReturn('login');
- $this->config
- ->expects($this->at(7))
- ->method('getSystemValue')
- ->with('mail_smtpauth', false)
- ->willReturn(true);
- $this->config
- ->expects($this->at(8))
- ->method('getSystemValue')
- ->with('mail_smtpname', '')
- ->willReturn('smtp.sender.com');
- $this->config
- ->expects($this->at(9))
- ->method('getSystemValue')
- ->with('mail_smtppassword', '')
- ->willReturn('mypassword');
- $this->config
- ->expects($this->at(10))
- ->method('getSystemValue')
- ->with('mail_sendmailmode', 'smtp')
- ->willReturn('smtp');
+ ->willReturnMap([
+ ['mail_domain', '', 'mx.nextcloud.com'],
+ ['mail_from_address', '', 'no-reply@nextcloud.com'],
+ ['mail_smtpmode', '', 'smtp'],
+ ['mail_smtpsecure', '', true],
+ ['mail_smtphost', '', 'smtp.nextcloud.com'],
+ ['mail_smtpport', '', 25],
+ ['mail_smtpauthtype', '', 'login'],
+ ['mail_smtpauth', false, true],
+ ['mail_smtpname', '', 'smtp.sender.com'],
+ ['mail_smtppassword', '', 'mypassword'],
+ ['mail_sendmailmode', 'smtp', 'smtp'],
+ ]);
$expected = new TemplateResponse(
'settings',
diff --git a/apps/settings/tests/Settings/Admin/ServerTest.php b/apps/settings/tests/Settings/Admin/ServerTest.php
index c5958c29421..74d9a5d53fd 100644
--- a/apps/settings/tests/Settings/Admin/ServerTest.php
+++ b/apps/settings/tests/Settings/Admin/ServerTest.php
@@ -93,20 +93,13 @@ class ServerTest extends TestCase {
->method('cronMaxAge')
->willReturn(1337);
$this->config
- ->expects($this->at(0))
+ ->expects($this->any())
->method('getAppValue')
- ->with('core', 'backgroundjobs_mode', 'ajax')
- ->willReturn('ajax');
- $this->config
- ->expects($this->at(1))
- ->method('getAppValue')
- ->with('core', 'lastcron', '0')
- ->willReturn('0');
- $this->config
- ->expects($this->at(2))
- ->method('getAppValue')
- ->with('core', 'cronErrors')
- ->willReturn('');
+ ->willReturnMap([
+ ['core', 'backgroundjobs_mode', 'ajax', 'ajax'],
+ ['core', 'lastcron', '0', '0'],
+ ['core', 'cronErrors', ''],
+ ]);
$this->profileManager
->expects($this->exactly(2))
->method('isProfileEnabled')