当前位置: 首页>>代码示例>>PHP>>正文


PHP ExampleNode::getTitle方法代码示例

本文整理汇总了PHP中PhpSpec\Loader\Node\ExampleNode::getTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP ExampleNode::getTitle方法的具体用法?PHP ExampleNode::getTitle怎么用?PHP ExampleNode::getTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhpSpec\Loader\Node\ExampleNode的用法示例。


在下文中一共展示了ExampleNode::getTitle方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 function it_orders_an_array_of_example_nodes(ExampleNode $a, ExampleNode $b, ExampleNode $c)
 {
     $a->getTitle()->willReturn('bar1');
     $b->getTitle()->willReturn('bar2');
     $c->getTitle()->willReturn('bar3');
     $nodes = [$a, $b, $c];
     $expected = [$c, $b, $a];
     $this->setSpecificationTitle('foo');
     $this->filter($nodes)->shouldReturn($expected);
 }
开发者ID:padraic,项目名称:phpspec-extensions,代码行数:10,代码来源:FastestFirstFilterSpec.php

示例2: prepare

 /**
  * @param ExampleNode            $example
  * @param SpecificationInterface $context
  * @param MatcherManager         $matchers
  * @param CollaboratorManager    $collaborators
  */
 public function prepare(ExampleNode $example, SpecificationInterface $context, MatcherManager $matchers, CollaboratorManager $collaborators)
 {
     $exampleNum = $this->getExampleNumber($example->getTitle());
     $providedData = $this->getDataFromProvider($example);
     if (!array_key_exists($exampleNum, $providedData)) {
         return;
     }
     $data = $providedData[$exampleNum];
     foreach ($example->getFunctionReflection()->getParameters() as $position => $parameter) {
         if (!isset($data[$position])) {
             continue;
         }
         $collaborators->set($parameter->getName(), $data[$position]);
     }
 }
开发者ID:coduo,项目名称:phpspec-data-provider-extension,代码行数:21,代码来源:DataProviderMaintainer.php

示例3: 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();
 }
开发者ID:phpspec,项目名称:phpspec,代码行数:18,代码来源:DotFormatterSpec.php

示例4: getTitle

 /**
  * @return string
  */
 public function getTitle()
 {
     return $this->example->getTitle();
 }
开发者ID:focuslife,项目名称:v0.1,代码行数:7,代码来源:ExampleEvent.php

示例5:

 function it_escapes_unicode_symbols(IO $io, ExampleNode $node)
 {
     $node->getTitle()->willReturn("Example 0x1234");
     $io->write("##teamcity[testIgnored name='Example |0x1234' message='Exception |0x4321!']\n")->shouldBeCalled();
     $this->afterExample($this->exampleEvent($node, ExampleEvent::PENDING, 0, 'Exception 0x4321!'));
 }
开发者ID:pawel-grzona,项目名称:teamcity-phpspec-extension,代码行数:6,代码来源:FormatterSpec.php


注:本文中的PhpSpec\Loader\Node\ExampleNode::getTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。