本文整理汇总了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);
}