Example #1
0
 public function runDefault()
 {
     $helpCommand = new Commands\Help();
     foreach ($this->detectAvailableTasks() as $section => $tasks) {
         if (!$helpCommand->hasSection($section)) {
             $helpCommand->addSection($section);
         }
         $helpCommand->setSectionTasks($section, $tasks);
     }
     $helpCommand->execute();
 }
Example #2
0
 public function testHelp()
 {
     ob_start();
     $help = new Commands\Help();
     $help->addSection('mySection');
     $help->addSection('mySection2');
     $help->setSectionTasks('mySection', ['myTask' => 'myTaskDesc']);
     $help->execute();
     $contents = ob_get_clean();
     $this->assertContains('Available tasks:', $contents);
     $this->assertContains('mySection', $contents);
     $this->assertContains('mySection2', $contents);
     $this->assertContains('myTask', $contents);
     $this->assertContains('myTaskDesc', $contents);
 }