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:
@@ -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()
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user