refreshApplication() public method

Refresh the application instance.
public refreshApplication ( Illuminate\Foundation\Application | null $app = null ) : void
$app Illuminate\Foundation\Application | null Optionally provide your own unbooted Laravel Application instance. This parameter can largely be ignored and is used just for unit testing
return void
Exemplo n.º 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('setLaravel')) {
         $this->laravel->refreshApplication();
     }
 }
Exemplo n.º 2
0
 function it_refreshes_the_laravel_framework_before_spec_is_run(Laravel $laravel, SpecificationEvent $event, SpecificationNode $spec, ReflectionClass $refl)
 {
     $event->getSpecification()->shouldBeCalled()->willReturn($spec);
     $spec->getClassReflection()->shouldBeCalled()->willReturn($refl);
     $refl->hasMethod('setLaravel')->shouldBeCalled()->willReturn(true);
     $laravel->refreshApplication()->shouldBeCalled();
     $this->beforeSpecification($event);
 }