本文整理匯總了PHP中PhpSpec\Loader\Node\ExampleNode::getLineNumber方法的典型用法代碼示例。如果您正苦於以下問題:PHP ExampleNode::getLineNumber方法的具體用法?PHP ExampleNode::getLineNumber怎麽用?PHP ExampleNode::getLineNumber使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PhpSpec\Loader\Node\ExampleNode
的用法示例。
在下文中一共展示了ExampleNode::getLineNumber方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: PendingException
function it_outputs_exceptions_for_failed_examples(SuiteEvent $event, ExampleEvent $pendingEvent, ConsoleIO $io, StatisticsCollector $stats, SpecificationNode $specification, ExampleNode $example)
{
$example->getLineNumber()->willReturn(37);
$example->getTitle()->willReturn('it tests something');
$pendingEvent->getException()->willReturn(new PendingException());
$pendingEvent->getSpecification()->willReturn($specification);
$pendingEvent->getExample()->willReturn($example);
$stats->getEventsCount()->willReturn(1);
$stats->getFailedEvents()->willReturn(array());
$stats->getBrokenEvents()->willReturn(array());
$stats->getPendingEvents()->willReturn(array($pendingEvent));
$stats->getSkippedEvents()->willReturn(array());
$stats->getTotalSpecs()->willReturn(1);
$stats->getCountsHash()->willReturn(array('passed' => 0, 'pending' => 1, 'skipped' => 0, 'failed' => 0, 'broken' => 0));
$this->afterSuite($event);
$expected = '<lineno> 37</lineno> <pending>- it tests something</pending>';
$io->writeln($expected)->shouldHaveBeenCalled();
}