/** * Register the service provider. * * @return void */ public function register() { $config = $this->app['config']->get('jira', []); $this->app['config']->set('jira', array_merge(require __DIR__ . '/../../config/jira.php', $config)); $config = $this->app['config']->get('jira', []); $this->app->bindShared('jiraprojectservice', function () use($config) { $service = new ProjectService($config); $service->setLogger($this->createLogger($config)); return $service; }); $this->app->bindShared('jiraissueservice', function () use($config) { $service = new IssueService($config); $service->setLogger($this->createLogger($config)); return $service; }); $this->app->bindShared('jirahookservice', function () use($config) { $service = new HookService($config); $service->setLogger($this->createLogger($config)); return $service; }); $this->app->bindShared('jirasearchservice', function () use($config) { $service = new SearchService($config); $service->setLogger($this->createLogger($config)); return $service; }); }
public function testGetProjectLists() { //$this->markTestIncomplete(); try { $proj = new ProjectService(); $prjs = $proj->getAllProjects(); foreach ($prjs as $p) { echo sprintf("Project Key:%s, Id:%s, Name:%s, projectCategory: %s\n", $p->key, $p->id, $p->name, $p->projectCategory['name']); } } catch (HTTPException $e) { $this->assertTrue(false, $e->getMessage()); } }
/** * @param InputInterface $input * @param OutputInterface $output */ protected function execute(InputInterface $input, OutputInterface $output) { $field_exclude = explode(',', $input->getOption('field-exclude')); try { $proj = new ProjectService(); $prjs = $proj->getAllProjects(); foreach ($prjs as $p) { $output->writeln($p->toString($field_exclude)); } } catch (JiraException $e) { $output->writeln("Error Occured! " . $e->getMessage()); } }
protected function execute(InputInterface $input, OutputInterface $output) { // project $nameOrKey = strtoupper($input->getArgument('name')); $field_exclude = explode(',', $input->getOption('field-exclude')); try { $proj = new ProjectService(); //Project $p = $proj->get($nameOrKey); $output->writeln($p->toString($field_exclude)); } catch (JiraException $e) { $output->writeln("Error Occured! " . $e->getMessage()); } }