當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。