Example #1
0
 /**
  * Log the result of a Robo task that was successful.
  */
 protected function printSuccess(Result $result)
 {
     $task = $result->getTask();
     $context = $result->getContext() + ['timer-label' => 'in'];
     $time = $result->getExecutionTime();
     if ($time) {
         $this->printMessage(ConsoleLogLevel::SUCCESS, 'Done', $context);
     }
     return false;
 }
Example #2
0
 public function testBasics()
 {
     $task = new ResultDummyTask();
     $result = new Result($task, 1, 'The foo barred', ['time' => 0]);
     $this->guy->seeInOutput('The foo barred');
     $this->guy->seeInOutput('Error');
     $this->guy->seeInOutput('[ResultDummyTask]');
     $this->assertSame($task, $result->getTask());
     $this->assertEquals(1, $result->getExitCode());
     $this->assertEquals('The foo barred', $result->getMessage());
     $this->assertEquals(['time' => 0], $result->getData());
     $taskClone = $result->cloneTask();
     $this->assertNotSame($task, $taskClone);
     $this->assertInstanceOf('Robo\\Task\\Shared\\TaskInterface', $taskClone);
 }