Simplify SettingsService Test
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
This commit is contained in:
parent
758f55d48f
commit
1ceeb68158
|
@ -54,47 +54,48 @@ class SettingsServiceTest extends TestCase {
|
|||
public function testGet() {
|
||||
$return = [
|
||||
'defaultCalendarId' => 'personal',
|
||||
'showHidden' => 0,
|
||||
'showHidden' => 1,
|
||||
'sortOrder' => 'default',
|
||||
'sortDirection' => false,
|
||||
'userID' => $this->userId
|
||||
];
|
||||
|
||||
$this->settings->expects($this->at(0))
|
||||
->method('getUserValue')
|
||||
->with(
|
||||
$this->equalTo($this->userId),
|
||||
$this->equalTo($this->appName),
|
||||
'various_defaultCalendarId'
|
||||
)
|
||||
->will($this->returnValue('personal'));
|
||||
$map = [
|
||||
[
|
||||
$this->userId,
|
||||
$this->appName,
|
||||
'various_defaultCalendarId',
|
||||
'',
|
||||
'personal'
|
||||
],
|
||||
[
|
||||
$this->userId,
|
||||
$this->appName,
|
||||
'various_showHidden',
|
||||
'',
|
||||
1
|
||||
],
|
||||
[
|
||||
$this->userId,
|
||||
$this->appName,
|
||||
'various_sortOrder',
|
||||
'',
|
||||
'default'
|
||||
],
|
||||
[
|
||||
$this->userId,
|
||||
$this->appName,
|
||||
'various_sortDirection',
|
||||
'',
|
||||
false
|
||||
]
|
||||
];
|
||||
|
||||
$this->settings->expects($this->at(1))
|
||||
$this->settings->expects($this->any())
|
||||
->method('getUserValue')
|
||||
->with(
|
||||
$this->equalTo($this->userId),
|
||||
$this->equalTo($this->appName),
|
||||
'various_showHidden'
|
||||
)
|
||||
->will($this->returnValue(0));
|
||||
|
||||
$this->settings->expects($this->at(2))
|
||||
->method('getUserValue')
|
||||
->with(
|
||||
$this->equalTo($this->userId),
|
||||
$this->equalTo($this->appName),
|
||||
'various_sortOrder'
|
||||
)
|
||||
->will($this->returnValue('default'));
|
||||
|
||||
$this->settings->expects($this->at(3))
|
||||
->method('getUserValue')
|
||||
->with(
|
||||
$this->equalTo($this->userId),
|
||||
$this->equalTo($this->appName),
|
||||
'various_sortDirection'
|
||||
)
|
||||
->will($this->returnValue(false));
|
||||
->will(
|
||||
$this->returnValueMap($map)
|
||||
);
|
||||
|
||||
$result = $this->settingsService->get();
|
||||
|
||||
|
|
Loading…
Reference in New Issue