mirror of
				https://github.com/getgrav/grav-plugin-admin.git
				synced 2025-11-03 20:05:53 +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 string $route
 | 
				
			||||||
     * @param array  $post
 | 
					     * @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->grav = $grav;
 | 
				
			||||||
        $this->view = $view;
 | 
					        $this->view = $view;
 | 
				
			||||||
@@ -107,7 +107,9 @@ class AdminController
 | 
				
			|||||||
        $this->post = $this->getPost($post);
 | 
					        $this->post = $this->getPost($post);
 | 
				
			||||||
        $this->route = $route;
 | 
					        $this->route = $route;
 | 
				
			||||||
        $this->admin = $this->grav['admin'];
 | 
					        $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