/** * @param TaskEvent $event */ public function advanceProgress(TaskEvent $event) { $taskReflection = new ReflectionClass($event->getTask()); $taskName = $taskReflection->getShortName(); $this->progressBar->setFormat($this->progressFormat); $this->progressBar->setMessage($taskName); $this->progressBar->advance(); }
function it_should_advance_progress(ProgressBar $progressBar, TaskEvent $event, TaskInterface $task) { $event->getTask()->willReturn($task); $progressBar->setFormat(Argument::type('string'))->shouldBeCalled(); $progressBar->setOverwrite(false)->shouldBeCalled(); $progressBar->setMessage(Argument::type('string'))->shouldBeCalled(); $progressBar->advance()->shouldBeCalled(); $this->advanceProgress($event); }
/** * @param TaskInterface $task * @param Exception $exception */ public function __construct(TaskInterface $task, Exception $exception) { parent::__construct($task); $this->exception = $exception; }