test that nonexistant text will throw error

This commit is contained in:
Yisroel Baum 2026-04-23 20:20:53 +03:00
parent c32087c35d
commit f8a1c2616d
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
2 changed files with 17 additions and 6 deletions

View file

@ -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)
);