зеркало из https://github.com/nextcloud/deck.git
Revert "Do not use getDisplayName for groups"
This reverts commit 12ebffb885
.
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Родитель
dfc8b15ab2
Коммит
5423894175
|
@ -35,7 +35,7 @@ class Group extends RelationalObject {
|
|||
public function getObjectSerialization() {
|
||||
return [
|
||||
'uid' => $this->object->getGID(),
|
||||
'displayname' => $this->object->getGID()
|
||||
'displayname' => $this->object->getDisplayName()
|
||||
];
|
||||
}
|
||||
}
|
|
@ -33,10 +33,13 @@ class GroupTest extends \Test\TestCase {
|
|||
$group->expects($this->any())
|
||||
->method('getGID')
|
||||
->willReturn('mygroup');
|
||||
$group->expects($this->any())
|
||||
->method('getDisplayName')
|
||||
->willReturn('My Group');
|
||||
$groupRelationalObject = new Group($group);
|
||||
$expected = [
|
||||
'uid' => 'mygroup',
|
||||
'displayname' => 'mygroup'
|
||||
'displayname' => 'My Group'
|
||||
];
|
||||
$this->assertEquals($expected, $groupRelationalObject->getObjectSerialization());
|
||||
}
|
||||
|
@ -47,12 +50,19 @@ class GroupTest extends \Test\TestCase {
|
|||
$group->expects($this->any())
|
||||
->method('getGID')
|
||||
->willReturn('mygroup');
|
||||
$group->expects($this->any())
|
||||
->method('getDisplayName')
|
||||
->willReturn('My Group');
|
||||
$groupRelationalObject = new Group($group);
|
||||
$expected = [
|
||||
'uid' => 'mygroup',
|
||||
'displayname' => 'mygroup',
|
||||
'displayname' => 'My Group',
|
||||
'primaryKey' => 'mygroup'
|
||||
];
|
||||
$this->assertEquals($expected, $groupRelationalObject->jsonSerialize());
|
||||
|
||||
$actual = $groupRelationalObject->jsonSerialize();
|
||||
asort($expected);
|
||||
asort($actual);
|
||||
$this->assertEquals($expected, $actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче