/** * @param Request|WebRequest $request * @return \watoki\curir\delivery\WebResponse */ public function respond(Request $request) { $this->app->prepare($request); if (!$this->isContainerTarget($request)) { $request = $request->withTarget(Path::fromString('execute'))->withArgument(ExecuteResource::ACTION_ARG, $request->getTarget()->toString()); } return parent::respond($request); }
protected function before() { $this->factory = new Factory(); $this->factory->setSingleton($this->action->registry); $this->access = $this->factory->setSingleton(new AccessControl()); $this->app = $this->factory->getInstance(WebApplication::class); $this->app->prepare(); }
protected function before() { $factory = new Factory(); $this->app = $factory->getInstance(WebApplication::class); $this->app->prepare(); $this->app->fields->add(new ActionField($this->app->fields, $this->app->actions)); $this->app->renderers->add(new PrimitiveRenderer()); $this->app->fields->add(new StringField()); }
private function whenIExecute_With($id, $parameters) { $this->app->prepare(); $reader = new FakeParameterReader($parameters); $execution = new ExecutionResource($this->app, $reader, new BreadCrumbsTrail($reader, [])); $this->response = $execution->handleGet($id); }