Unit Test : Access child properties from parent class
Hi Folks !
I have a situation here related to PHP OOP...im trying to write unit test for the class TypeAlert.php bellow :
final class TypeAlert extends Enum
{
const INFO = 0;
const SUCESS = 1;
const WARNING = 2;
const ERROR = 3;
}
In the other hand i have the parent class defined as bellow Enum.php:
use App\Enums\Exceptions\EnumNotFoundProperty;
abstract class Enum {
public static function __callStatic(string $name, array $arguments)
{
if(defined(static::class."::$name"))
{
return static::$$name;
}
throw new EnumNotFoundProperty($name);
}
}
when i run the unit test the console says that im tryin to Access undeclared static property App\Enums\TypeAlert::$WARNING (For example)....what's wrong with my code ?