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


PHP IO::isCodeGenerationEnabled方法代码示例

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


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

示例1:

 function it_does_not_prompt_when_code_generation_is_disabled(IO $io, ExampleEvent $exampleEvent, SuiteEvent $suiteEvent)
 {
     $io->isCodeGenerationEnabled()->willReturn(false);
     $this->afterExample($exampleEvent);
     $this->afterSuite($suiteEvent);
     $io->askConfirmation(Argument::any())->shouldNotHaveBeenCalled();
 }
开发者ID:edwardricardo,项目名称:zenska,代码行数:7,代码来源:CollaboratorNotFoundListenerSpec.php

示例2: afterSuite

 /**
  * @param SuiteEvent $event
  */
 public function afterSuite(SuiteEvent $event)
 {
     if (!$this->io->isCodeGenerationEnabled()) {
         return;
     }
     foreach ($this->exceptions as $exception) {
         $resource = $this->resources->createResource($exception->getCollaboratorName());
         if ($this->resourceIsInSpecNamespace($exception, $resource)) {
             continue;
         }
         if ($this->io->askConfirmation(sprintf('Would you like me to generate an interface `%s` for you?', $exception->getCollaboratorName()))) {
             $this->generator->generate($resource, 'interface');
             $event->markAsWorthRerunning();
         }
     }
 }
开发者ID:EnmanuelCode,项目名称:backend-laravel,代码行数:19,代码来源:CollaboratorNotFoundListener.php

示例3: afterSuite

 public function afterSuite(SuiteEvent $event)
 {
     if (!$this->io->isCodeGenerationEnabled()) {
         return;
     }
     if (!$this->io->isFakingEnabled()) {
         return;
     }
     foreach ($this->nullMethods as $methodString => $failedCall) {
         $failedCall['expected'] = array_unique($failedCall['expected']);
         if (count($failedCall['expected']) > 1) {
             continue;
         }
         $expected = current($failedCall['expected']);
         $class = $failedCall['class'];
         $message = sprintf('Do you want me to make `%s()` always return %s for you?', $methodString, var_export($expected, true));
         try {
             $resource = $this->resources->createResource($class);
         } catch (\RuntimeException $exception) {
             continue;
         }
         if ($this->io->askConfirmation($message)) {
             $this->generator->generate($resource, 'returnConstant', array('method' => $failedCall['method'], 'expected' => $expected));
             $event->markAsWorthRerunning();
         }
     }
 }
开发者ID:ProgrammingPeter,项目名称:nba-schedule-api,代码行数:27,代码来源:MethodReturnedNullListener.php

示例4:

 function it_does_not_prompt_when_code_generation_is_disabled(IO $io, ExampleEvent $event, SuiteEvent $suiteEvent, MethodNotFoundException $exception)
 {
     $io->isCodeGenerationEnabled()->willReturn(false);
     $exception->getClassname()->willReturn('spec\\PhpSpec\\Listener\\DoubleOfInterface');
     $exception->getMethodName()->willReturn('aMethod');
     $this->afterExample($event);
     $this->afterSuite($suiteEvent);
     $io->askConfirmation(Argument::any())->shouldNotHaveBeenCalled();
 }
开发者ID:qasem2rubik,项目名称:laravel,代码行数:9,代码来源:CollaboratorMethodNotFoundListenerSpec.php

示例5: getMethodNotFoundException

 /**
  * @param ExampleEvent $event
  * @return bool
  */
 private function getMethodNotFoundException(ExampleEvent $event)
 {
     if ($this->io->isCodeGenerationEnabled() && ($exception = $event->getException()) && $exception instanceof MethodNotFoundException) {
         return $exception;
     }
 }
开发者ID:edwardricardo,项目名称:zenska,代码行数:10,代码来源:CollaboratorMethodNotFoundListener.php

示例6:

 function it_does_not_prompt_when_input_is_not_interactive(MethodCallEvent $methodCallEvent, ExampleEvent $exampleEvent, IO $io, SuiteEvent $event)
 {
     $io->isCodeGenerationEnabled()->willReturn(false);
     $this->afterMethodCall($methodCallEvent);
     $this->afterExample($exampleEvent);
     $this->afterSuite($event);
     $io->askConfirmation(Argument::any())->shouldNotHaveBeenCalled();
 }
开发者ID:HarveyCheng,项目名称:myblog,代码行数:8,代码来源:MethodReturnedNullListenerSpec.php

示例7: let

 function let(ModuleGenerator $moduleGenerator, ConfigGenerator $configGenerator, IO $io, ClassDetector $detector)
 {
     $io->isCodeGenerationEnabled()->willReturn(true);
     $detector->classExists(Argument::any())->willReturn(true);
     $this->beConstructedWith($moduleGenerator, $configGenerator, $io, $detector);
 }
开发者ID:kbulloch,项目名称:MageSpec_vm,代码行数:6,代码来源:ModuleUpdateListenerSpec.php


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