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:
Arthur Schiwon
2019-05-23 17:16:42 +02:00
parent dfc8b15ab2
commit 5423894175
2 changed files with 15 additions and 5 deletions

View File

@@ -35,7 +35,7 @@ class Group extends RelationalObject {
public function getObjectSerialization() { public function getObjectSerialization() {
return [ return [
'uid' => $this->object->getGID(), 'uid' => $this->object->getGID(),
'displayname' => $this->object->getGID() 'displayname' => $this->object->getDisplayName()
]; ];
} }
} }

View File

@@ -33,10 +33,13 @@ class GroupTest extends \Test\TestCase {
$group->expects($this->any()) $group->expects($this->any())
->method('getGID') ->method('getGID')
->willReturn('mygroup'); ->willReturn('mygroup');
$group->expects($this->any())
->method('getDisplayName')
->willReturn('My Group');
$groupRelationalObject = new Group($group); $groupRelationalObject = new Group($group);
$expected = [ $expected = [
'uid' => 'mygroup', 'uid' => 'mygroup',
'displayname' => 'mygroup' 'displayname' => 'My Group'
]; ];
$this->assertEquals($expected, $groupRelationalObject->getObjectSerialization()); $this->assertEquals($expected, $groupRelationalObject->getObjectSerialization());
} }
@@ -47,12 +50,19 @@ class GroupTest extends \Test\TestCase {
$group->expects($this->any()) $group->expects($this->any())
->method('getGID') ->method('getGID')
->willReturn('mygroup'); ->willReturn('mygroup');
$group->expects($this->any())
->method('getDisplayName')
->willReturn('My Group');
$groupRelationalObject = new Group($group); $groupRelationalObject = new Group($group);
$expected = [ $expected = [
'uid' => 'mygroup', 'uid' => 'mygroup',
'displayname' => 'mygroup', 'displayname' => 'My Group',
'primaryKey' => 'mygroup' 'primaryKey' => 'mygroup'
]; ];
$this->assertEquals($expected, $groupRelationalObject->jsonSerialize());
$actual = $groupRelationalObject->jsonSerialize();
asort($expected);
asort($actual);
$this->assertEquals($expected, $actual);
} }
} }