public function testCreateUserWithDisabledValidationWillProceedImmediatelyToSave() { $user = $this->createExampleUser(); $this->validatorMock->expects($this->never())->method('validate'); $this->repositoryMock->expects($this->once())->method('save')->with($user); $this->useCase->createUser($user, false); }
/** * @param User $user * @param Request $request * @return View */ private function processForm(User $user, Request $request) { $form = $this->formFactory->createNamed('', 'user_create', $user); $form->handleRequest($request); if (!$form->isValid()) { return new View($form, 400); } $this->useCase->createUser($user, false); return new View($user, 201, ['Location' => $this->router->generate('arkon_user_getUser', ['id' => $user->getId()], true)]); }