本文整理匯總了PHP中GrumPHP\Task\Context\ContextInterface::getWrappedObject方法的典型用法代碼示例。如果您正苦於以下問題:PHP ContextInterface::getWrappedObject方法的具體用法?PHP ContextInterface::getWrappedObject怎麽用?PHP ContextInterface::getWrappedObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GrumPHP\Task\Context\ContextInterface
的用法示例。
在下文中一共展示了ContextInterface::getWrappedObject方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
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);
}
示例2: TaskResultCollection
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);
}