forked from GNUsocial/gnu-social
[TESTS] Add tests to all relevant methods under App\Util and fix errors that popup
This commit is contained in:
@@ -48,7 +48,7 @@ use Twig\Extension\RuntimeExtensionInterface;
|
||||
class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface
|
||||
{
|
||||
private Request $request;
|
||||
public function __constructor(Request $req)
|
||||
public function setRequest(Request $req)
|
||||
{
|
||||
$this->request = $req;
|
||||
}
|
||||
@@ -103,19 +103,6 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface
|
||||
return $styles;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------
|
||||
|
||||
// Request is not a service, can't find a better way to get it
|
||||
public function onKernelRequest(RequestEvent $event)
|
||||
{
|
||||
$this->request = $event->getRequest();
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return [KernelEvents::REQUEST => 'onKernelRequest'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the Svg Icon template and returns it.
|
||||
*
|
||||
@@ -142,4 +129,17 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------
|
||||
|
||||
// Request is not a service, can't find a better way to get it
|
||||
public function onKernelRequest(RequestEvent $event)
|
||||
{
|
||||
$this->request = $event->getRequest();
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return [KernelEvents::REQUEST => 'onKernelRequest'];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user