public function testCallGetContributorsBadRequest() { $adapter = Console::detectBestAdapter(); $consoleAdapter = new $adapter(); $expected = "HTTP/1.1 400 Bad Request\r\n\r\n"; $this->httpClient->getAdapter()->setResponse($expected); $controller = new ConsoleController($consoleAdapter, ['console' => ['contributors' => ['output' => 'foo.pson']]], $this->httpClient); $controller->getcontributorsAction(); }
/** * Create service * * @param ServiceLocatorInterface $serviceLocator * @return mixed */ public function createService(ServiceLocatorInterface $serviceLocator) { if ($serviceLocator instanceof AbstractPluginManager) { $serviceLocator = $serviceLocator->getServiceLocator(); } /** @var CommandBus $commandBus */ $commandBus = $serviceLocator->get('commandBus'); $instance = new ConsoleController(); $instance->setCommandBus($commandBus); return $instance; }
public function getControllerConfig() { return array('factories' => array('Application\\Controller\\Console' => function ($controllers) { $services = $controllers->getServiceLocator(); $config = $services->get('Config'); $config = $config['console']; $controller = new Controller\ConsoleController(); $controller->setConsole($services->get('Console')); $controller->setConfig($config); return $controller; })); }