getAllProjects() public method

get all project list.
public getAllProjects ( ) : array
return array of Project class
 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());
     }
 }
示例#2
0
 /**
  * @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());
     }
 }