test that nonexistant text will throw error
This commit is contained in:
parent
c32087c35d
commit
f8a1c2616d
2 changed files with 17 additions and 6 deletions
|
|
@ -49,6 +49,9 @@ class CreatePlan
|
|||
}
|
||||
$textId = $request->textId;
|
||||
$text = $this->textRepo->find($textId);
|
||||
if ($text === null) {
|
||||
throw new DomainException("Text with id: $textId doesnt exist");
|
||||
}
|
||||
$nodesOfText = $this->filterForNonParentNodes(
|
||||
$this->nodeRepo->findByTextId($textId)
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue