Optimized test and CreateSourceAction

This commit is contained in:
Kevin Frantz
2019-09-19 23:24:38 +02:00
parent 893467acca
commit 66ea3e83fd
2 changed files with 10 additions and 7 deletions

View File

@@ -66,16 +66,16 @@ final class CreateSourceAction extends AbstractCreateAction
/**
* {@inheritdoc}
*
* @todo Needs to be implemented and recheckt
*
* @see \Infinito\Domain\Action\AbstractAction::isValid()
*/
protected function isValid(): bool
{
//The following Exception just exists out of debuging reasons during the development process
if (!$this->form->isSubmitted()) {
throw new \Exception('The form is not submitted!');
}
$request = $this->actionService->getRequest()->request->all();
$this->form->submit($request);
return $this->form->isValid();
return $this->form->isSubmitted() && $this->form->isValid();
}
/**