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


PHP ExampleEvent::getTitle方法代码示例

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


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

示例1: CurrentExampleTracker

 function it_should_call_afterCurrentExample(ExampleEvent $example)
 {
     $currentExample = new CurrentExampleTracker();
     $currentExample->setCurrentExample(null);
     $example->getTitle()->willReturn(null);
     $this->afterCurrentExample($example);
     $example->getTitle()->shouldNotHaveBeenCalled();
 }
开发者ID:focuslife,项目名称:v0.1,代码行数:8,代码来源:CurrentExampleListenerSpec.php

示例2: afterExample

 public function afterExample(ExampleEvent $event)
 {
     $type = $this->map[$event->getResult()];
     $this->addResult($type, $event->getSpecification(), $event->getTitle());
     if ($this->coverage) {
         $this->coverage->stop();
     }
 }
开发者ID:phpguard,项目名称:plugin-phpspec,代码行数:8,代码来源:PhpGuardExtension.php

示例3: array

 function it_writes_a_fail_message_for_a_failing_example(Template $template, ExampleEvent $event, Presenter $presenter)
 {
     $event->getTitle()->willReturn(self::EVENT_TITLE);
     $event->getMessage()->willReturn(self::EVENT_MESSAGE);
     $event->getBacktrace()->willReturn(self::$BACKTRACE);
     $event->getException()->willReturn(new \Exception());
     $template->render(Template::DIR . '/Template/ReportFailed.html', array('title' => self::EVENT_TITLE, 'message' => self::EVENT_MESSAGE, 'backtrace' => self::BACKTRACE, 'code' => self::CODE, 'index' => 1, 'specification' => 1))->shouldBeCalled();
     $presenter->presentException(Argument::cetera())->willReturn(self::CODE);
     $this->write(1);
 }
开发者ID:edwardricardo,项目名称:zenska,代码行数:10,代码来源:ReportFailedItemSpec.php

示例4: ExceptionStub

 function it_stores_a_testcase_node_after_failed_example_run(ExampleEvent $event, SpecificationNode $specification, \ReflectionClass $refClass)
 {
     $event->getResult()->willReturn(ExampleEvent::FAILED);
     $event->getTitle()->willReturn('example title');
     $event->getTime()->willReturn(1337);
     $event->getException()->willReturn(new ExceptionStub('Something went wrong', 'Exception trace'));
     $event->getSpecification()->willReturn($specification);
     $specification->getClassReflection()->willReturn($refClass);
     $refClass->getName()->willReturn('Acme\\Foo\\Bar');
     $this->afterExample($event);
     $this->getTestCaseNodes()->shouldReturn(array('<testcase name="example title" time="1337" classname="Acme\\Foo\\Bar" status="failed">' . "\n" . '<failure type="spec\\PhpSpec\\Formatter\\ExceptionStub" message="Something went wrong" />' . "\n" . '<system-err>' . "\n" . '<![CDATA[' . "\n" . 'Exception trace' . "\n" . ']]>' . "\n" . '</system-err>' . "\n" . '</testcase>'));
 }
开发者ID:mawaha,项目名称:tracker,代码行数:12,代码来源:JUnitFormatterSpec.php

示例5: SkippingException

 function it_stores_a_testcase_node_after_skipped_example_run(ExampleEvent $event, SpecificationNode $specification, \ReflectionClass $refClass)
 {
     $event->getResult()->willReturn(ExampleEvent::SKIPPED);
     $event->getTitle()->willReturn('example title');
     $event->getTime()->willReturn(1337);
     $event->getException()->willReturn(new SkippingException('zog zog'));
     $event->getSpecification()->willReturn($specification);
     $specification->getClassReflection()->willReturn($refClass);
     $refClass->getName()->willReturn('Acme\\Foo\\Bar');
     $this->afterExample($event);
     // skipped tag is escaped because a skipped tag is also registered in the console formatter
     $this->getTestCaseNodes()->shouldReturn(array('<testcase name="example title" time="1337.000000" classname="Acme\\Foo\\Bar" status="skipped">' . "\n" . '\\<skipped><![CDATA[ skipped: zog zog ]]>\\</skipped>' . "\n" . '</testcase>'));
 }
开发者ID:focuslife,项目名称:v0.1,代码行数:13,代码来源:JUnitFormatterSpec.php

示例6: let

 function let(SpecificationNode $specificationNode, ExampleEvent $exampleEvent, ServiceContainer $container, CodeCoverageSession $coverageSession)
 {
     $r = new \ReflectionClass(__CLASS__);
     $specificationNode->getClassReflection()->willReturn($r);
     $specificationNode->getTitle()->willReturn('Specification');
     $exampleEvent->getSpecification()->willReturn($specificationNode);
     $exampleEvent->getTitle()->willReturn('it should do something');
     $this->cwd = getcwd();
     chdir(sys_get_temp_dir());
     $container->get('coverage.session')->willReturn($coverageSession);
     $this->setCoverageRunner($coverageSession);
     $this->load($container);
 }
开发者ID:phpguard,项目名称:plugin-phpspec,代码行数:13,代码来源:PhpGuardExtensionSpec.php

示例7: afterExample

 /**
  * @param ExampleEvent $event
  */
 public function afterExample(ExampleEvent $event)
 {
     $io = $this->getIO();
     $output = ob_get_clean();
     if ($output) {
         $io->writeln($this->teamCityMessage("testStdOut", array("name" => $event->getTitle(), "out" => "Test Output\n>>>>>>>>>>>\n{$output}\n<<<<<<<<<<<\n")));
     }
     switch ($event->getResult()) {
         case ExampleEvent::PASSED:
             break;
         case ExampleEvent::PENDING:
             $io->writeln($this->teamCityMessage('testIgnored', array('name' => $event->getTitle(), 'details' => $event->getMessage())));
             break;
         case ExampleEvent::FAILED:
             $io->writeln($this->teamCityMessage('testFailed', array('name' => $event->getTitle(), 'message' => "Failed Test\n\n" . $event->getMessage(), 'details' => $event->getException()->getTraceAsString())));
             break;
         case ExampleEvent::BROKEN:
             $io->writeln($this->teamCityMessage('testFailed', array('name' => $event->getTitle(), 'message' => "Broken Test\n\n" . $event->getMessage(), 'details' => $event->getException()->getTraceAsString())));
             break;
     }
     $io->writeln($this->teamCityMessage('testFinished', array('name' => $event->getTitle())));
 }
开发者ID:ascii-soup,项目名称:phpspec-teamcity-formatter,代码行数:25,代码来源:TeamCityFormatter.php

示例8: write

 /**
  *
  * @param int $index        	
  */
 public function write($index)
 {
     $code = $this->presenter->presentException($this->event->getException(), true);
     $this->template->render(Template::DIR . '/Template/ReportFailed.html', array('title' => htmlentities(strip_tags($this->event->getTitle())), 'message' => htmlentities(strip_tags($this->event->getMessage())), 'backtrace' => $this->formatBacktrace(), 'code' => $code, 'index' => self::$failingExamplesCount++, 'specification' => $index));
 }
开发者ID:ngitimfoyo,项目名称:Nyari-AppPHP,代码行数:9,代码来源:ReportFailedItem.php

示例9: afterExample

 /**
  * {@inheritdoc}
  */
 public function afterExample(ExampleEvent $event)
 {
     $testCaseNode = sprintf('<testcase name="%s" time="%s" classname="%s" status="%s"', $event->getTitle(), $event->getTime(), $event->getSpecification()->getClassReflection()->getName(), $this->jUnitStatuses[$event->getResult()]);
     $this->exampleStatusCounts[$event->getResult()]++;
     if (in_array($event->getResult(), array(ExampleEvent::BROKEN, ExampleEvent::FAILED))) {
         $exception = $event->getException();
         $testCaseNode .= sprintf('>' . "\n" . '<%s type="%s" message="%s" />' . "\n" . '<system-err>' . "\n" . '<![CDATA[' . "\n" . '%s' . "\n" . ']]>' . "\n" . '</system-err>' . "\n" . '</testcase>', $this->resultTags[$event->getResult()], get_class($exception), htmlspecialchars($exception->getMessage()), $exception->getTraceAsString());
     } else {
         $testCaseNode .= ' />';
     }
     $this->testCaseNodes[] = $testCaseNode;
 }
开发者ID:mawaha,项目名称:tracker,代码行数:15,代码来源:JUnitFormatter.php

示例10: array

 function it_writes_a_pass_message_for_a_passing_example(Template $template, ExampleEvent $event)
 {
     $event->getTitle()->willReturn(self::EVENT_TITLE);
     $template->render(Template::DIR . '/Template/ReportPending.html', array('title' => self::EVENT_TITLE, 'pendingExamplesCount' => 1))->shouldBeCalled();
     $this->write();
 }
开发者ID:ngitimfoyo,项目名称:Nyari-AppPHP,代码行数:6,代码来源:ReportPendingItemSpec.php

示例11: write

 /**
  */
 public function write()
 {
     $this->template->render(Template::DIR . '/Template/ReportPending.html', array('title' => $this->event->getTitle(), 'pendingExamplesCount' => self::$pendingExamplesCount));
     self::$pendingExamplesCount++;
 }
开发者ID:ngitimfoyo,项目名称:Nyari-AppPHP,代码行数:7,代码来源:ReportPendingItem.php

示例12: write

 /**
  *
  */
 public function write()
 {
     $this->template->render(Template::DIR . '/Template/ReportPass.html', array('title' => $this->event->getTitle()));
 }
开发者ID:edwardricardo,项目名称:zenska,代码行数:7,代码来源:ReportPassedItem.php

示例13: write

 /**
  *
  */
 public function write()
 {
     $this->template->render(Template::DIR . '/Template/ReportSkipped.html', array('title' => htmlentities(strip_tags($this->event->getTitle())), 'message' => htmlentities(strip_tags($this->event->getMessage()))));
 }
开发者ID:umpirsky,项目名称:phpspec,代码行数:7,代码来源:ReportSkippedItem.php

示例14: beforeCurrentExample

 public function beforeCurrentExample(ExampleEvent $event)
 {
     $this->currentExample->setCurrentExample($event->getTitle());
 }
开发者ID:nix9,项目名称:laracasts,代码行数:4,代码来源:CurrentExampleListener.php

示例15: afterExample

 public function afterExample(ExampleEvent $event)
 {
     $this->logger->logExample($event->getSpecification()->getTitle(), $event->getTitle(), $event->getTime());
 }
开发者ID:padraic,项目名称:phpspec-extensions,代码行数:4,代码来源:TimeCollectorListener.php


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