mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 18:28:49 +02:00
Added some tests for important entity methods.
This commit is contained in:
parent
0663a00df8
commit
89258bc102
18 changed files with 480 additions and 160 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue