How to login to unit test zf2?

What to add to during testing of the controller he saw his alleged tests, authorized user Unit test ZF2
public function _before(\UnitTester $I)
{
 $serviceManager = Bootstrap::getServiceManager();
 $this->controller = new TaskController();
 $this->request = new Request();
 $this->response = new response();
 $this->routeMatch = new RouteMatch(['controller' => 'Task']);
 $this->event = new MvcEvent();
 $config = $serviceManager->get('Config');
 $routeConfig = isset($config['router']) ? $config['router'] : [];
 $router = HttpRouter::factory($routeConfig);

$this->event->setRouter($router);
$this->event->setRouteMatch($this->routeMatch);
$this->event->setRequest($this->request);
$this->event->setResponse($this->response);
$this->controller->setEvent($this->event);
$this->controller->setServiceLocator($serviceManager);
 }
July 2nd 19 at 14:20
0 answer

Find more questions by tags Zend Framework