Skip to content

Commit 6340eec

Browse files
committed
Missing test. When @Embedded(nullable=false)
1 parent 40dfa3f commit 6340eec

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,20 @@ public function testThrowsExceptionOnInfiniteEmbeddableNesting($embeddableClassN
243243
));
244244
}
245245

246+
public function testThrowsExceptionWhenPersistingWithNullOnNonNullableEmbedded()
247+
{
248+
$this->setExpectedException('Doctrine\DBAL\Exception\NotNullConstraintViolationException');
249+
250+
$event = new DDC3529Event();
251+
$event->name = 'PHP Conference';
252+
$event->period = new DDC3529DateInterval(new \DateTime('2015-01-20 08:00:00'), new \DateTime('2015-01-23 19:00:00'));
253+
254+
$this->_em->persist($event);
255+
$this->_em->flush();
256+
257+
return $event;
258+
}
259+
246260
public function testNoErrorsShouldHappenWhenPersistingAnEntityWithNullableEmbedded()
247261
{
248262
$event = new DDC3529Event();

0 commit comments

Comments
 (0)