mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-01 14:04:30 +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
|
@ -73,15 +73,11 @@ abstract class NamedDBElement extends DBElement
|
|||
*********************************************************************************/
|
||||
|
||||
/**
|
||||
* Get the name.
|
||||
*
|
||||
* Get the name of this element
|
||||
* @return string the name of this element
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
/*
|
||||
//Strip HTML from Name, so no XSS injection is possible.
|
||||
return strip_tags($this->name); */
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
|
@ -94,12 +90,7 @@ abstract class NamedDBElement extends DBElement
|
|||
/**
|
||||
* Change the name of this element.
|
||||
*
|
||||
* Spaces at the begin and at the end of the string will be removed
|
||||
* automatically in NamedDBElement::check_values_validity().
|
||||
* So you don't have to do this yourself.
|
||||
*
|
||||
* @param string $new_name the new name
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setName(string $new_name): self
|
||||
|
@ -115,8 +106,6 @@ abstract class NamedDBElement extends DBElement
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getName();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue