Added some tests for important entity methods.

This commit is contained in:
Jan Böhmer 2019-11-09 00:31:42 +01:00
parent 0663a00df8
commit 89258bc102
18 changed files with 480 additions and 160 deletions

View file

@ -406,12 +406,11 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
*/
public function getFullName(bool $including_username = false): string
{
$str = $this->getFirstName().' '.$this->getLastName();
if ($including_username) {
$str .= ' ('.$this->getName().')';
return sprintf('%s %s (%s)', $this->getFirstName(), $this->getLastName(), $this->getName());
}
return $str;
return sprintf('%s %s', $this->getFirstName(), $this->getLastName());
}
public function setName(string $new_name): NamedDBElement