/** * 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(); } }
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); }