예제 #1
0
 /**
  * Run the `beforeSpecification` hook.
  *
  * @param  \PhpSpec\Event\SpecificationEvent $event
  * @return void
  */
 public function beforeSpecification(SpecificationEvent $event)
 {
     $spec = $event->getSpecification();
     if ($spec->getClassReflection()->hasMethod('setLumen')) {
         $this->lumen->refreshApplication();
     }
 }
예제 #2
0
 function it_refreshes_the_lumen_framework_before_spec_is_run(Lumen $lumen, SpecificationEvent $event, SpecificationNode $spec, ReflectionClass $refl)
 {
     $event->getSpecification()->shouldBeCalled()->willReturn($spec);
     $spec->getClassReflection()->shouldBeCalled()->willReturn($refl);
     $refl->hasMethod('setLumen')->shouldBeCalled()->willReturn(true);
     $lumen->refreshApplication()->shouldBeCalled();
     $this->beforeSpecification($event);
 }