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

@ -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();