Fix tests

This commit is contained in:
Philipp Holzer 2019-07-26 15:54:14 +02:00
parent 2a87464c97
commit 07aaf292ec
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
12 changed files with 134 additions and 144 deletions

View file

@ -42,7 +42,7 @@ class BaseObject
*/
public static function getApp()
{
return self::$dice->create(App::class);
return self::getClass(App::class);
}
/**
@ -54,8 +54,12 @@ class BaseObject
*
* @throws InternalServerErrorException
*/
public static function getClass(string $name)
protected static function getClass(string $name)
{
if (empty(self::$dice)) {
throw new InternalServerErrorException('DICE isn\'t initialized.');
}
if (class_exists($name) || interface_exists($name )) {
return self::$dice->create($name);
} else {