function it_has_failed_if_it_contains_failed_task_result(TaskInterface $task, ContextInterface $context) { $aTask = $task->getWrappedObject(); $aContext = $context->getWrappedObject(); $this->add(TaskResult::createPassed($aTask, $aContext)); $this->add(TaskResult::createNonBlockingFailed($aTask, $aContext, 'non blocking')); $this->isFailed()->shouldReturn(false); $this->add(TaskResult::createFailed($aTask, $aContext, 'failed message')); $this->isFailed()->shouldReturn(true); }
function it_should_display_warning_of_non_blocking_failed_tasks(OutputInterface $output, TaskRunner $taskRunner, TaskInterface $task, ContextInterface $context) { $aTask = $task->getWrappedObject(); $aContext = $context->getWrappedObject(); $nonBlockingFailedTaskResult = TaskResult::createNonBlockingFailed($aTask, $aContext, 'non blocking task message'); $taskResults = new TaskResultCollection(); $taskResults->add($nonBlockingFailedTaskResult); $taskRunner->run($context)->willReturn($taskResults); $output->isDecorated()->willReturn(false); $output->getVerbosity()->willReturn(OutputInterface::VERBOSITY_NORMAL); $output->writeln(Argument::containingString('non blocking task message'))->shouldBeCalled(); $output->writeln(Argument::any())->shouldBeCalled(); $this->run($output, $context); }
function it_triggers_events_during_error_flow(EventDispatcherInterface $eventDispatcher, TaskInterface $task1, TaskInterface $task2, ContextInterface $context) { $task1->run($context)->willReturn(TaskResult::createFailed($task1->getWrappedObject(), $context->getWrappedObject(), '')); $task2->run($context)->willReturn(TaskResult::createFailed($task1->getWrappedObject(), $context->getWrappedObject(), '')); $eventDispatcher->dispatch(RunnerEvents::RUNNER_RUN, Argument::type('GrumPHP\\Event\\RunnerEvent'))->shouldBeCalled(); $eventDispatcher->dispatch(TaskEvents::TASK_RUN, Argument::type('GrumPHP\\Event\\TaskEvent'))->shouldBeCalled(); $eventDispatcher->dispatch(TaskEvents::TASK_FAILED, Argument::type('GrumPHP\\Event\\TaskFailedEvent'))->shouldBeCalled(); $eventDispatcher->dispatch(RunnerEvents::RUNNER_FAILED, Argument::type('GrumPHP\\Event\\RunnerFailedEvent'))->shouldBeCalled(); $this->run($context); }