test and impl that only one root node exists per text
in practice this means only one node with a null parentNode
This commit is contained in:
parent
4f83ae7926
commit
d1eb648b73
2 changed files with 37 additions and 0 deletions
|
|
@ -95,4 +95,20 @@ class CreateNodeTest extends TestCase
|
|||
parentNodeId: 0,
|
||||
));
|
||||
}
|
||||
|
||||
public function test_one_root_node_per_text(): void
|
||||
{
|
||||
$this->expectException(DomainException::class);
|
||||
$this->expectExceptionMessage('A root node already exists for this text');
|
||||
$this->useCase->execute(new CreateNodeRequest(
|
||||
textId: 0,
|
||||
title: 'test',
|
||||
parentNodeId: null,
|
||||
));
|
||||
$this->useCase->execute(new CreateNodeRequest(
|
||||
textId: 0,
|
||||
title: 'test',
|
||||
parentNodeId: null,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue