mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 03:16:11 +01:00
Allow controller to be initialized in test without having to instantiate Grav
This commit is contained in:
@@ -92,7 +92,7 @@ class AdminController
|
||||
* @param string $route
|
||||
* @param array $post
|
||||
*/
|
||||
public function __construct(Grav $grav, $view, $task, $route, $post)
|
||||
public function __construct(Grav $grav = null, $view = null, $task = null, $route = null, $post = null)
|
||||
{
|
||||
$this->grav = $grav;
|
||||
$this->view = $view;
|
||||
@@ -107,7 +107,9 @@ class AdminController
|
||||
$this->post = $this->getPost($post);
|
||||
$this->route = $route;
|
||||
$this->admin = $this->grav['admin'];
|
||||
$this->uri = $this->grav['uri']->url();
|
||||
if ($this->grav['uri']) {
|
||||
$this->uri = $this->grav['uri']->url();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user