Example #1
0
 private function givenANonModifyingAction($actionId)
 {
     $this->action = Mockster::of(Action::class);
     $this->app->actions->add($actionId, Mockster::mock($this->action));
     Mockster::stub($this->action->execute(Arg::any()))->will()->return_('Value of ' . $actionId);
     Mockster::stub($this->action->isModifying())->will()->return_(false);
     Mockster::stub($this->action->caption())->will()->return_('My Foo');
     Mockster::stub($this->action->parameters())->will()->return_([new Parameter('one', new StringType())]);
 }
Example #2
0
 protected function handleValueResult(ValueResult $result)
 {
     $value = $result->getValue();
     $renderer = $this->renderers->getRenderer($value);
     if ($renderer instanceof WebRenderer) {
         $this->headElements = $renderer->headElements($value);
     }
     $this->model['output'] = $renderer->render($value);
     if (!$this->action->isModifying()) {
         $this->crumbs->updateCrumbs($this->action, $this->actionId);
     }
 }