diff --git a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php index 893a3e31e..fc90d6cad 100644 --- a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php +++ b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php @@ -127,7 +127,7 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister public function executeInserts() { if ( ! $this->queuedInserts) { - return; + return array(); } $postInsertIds = array(); diff --git a/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php b/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php new file mode 100644 index 000000000..6c3bce3cf --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php @@ -0,0 +1,64 @@ +. + */ + +namespace Doctrine\Tests\ORM\Persisters; + +use Doctrine\ORM\Persisters\JoinedSubclassPersister; +use Doctrine\Tests\OrmTestCase; + +/** + * Tests for {@see \Doctrine\ORM\Persisters\JoinedSubclassPersister} + * + * @covers \Doctrine\ORM\Persisters\JoinedSubclassPersister + */ +class JoinedSubClassPersisterTest extends OrmTestCase +{ + /** + * @var JoinedSubclassPersister + */ + protected $persister; + + /** + * @var \Doctrine\ORM\EntityManager + */ + protected $em; + + /** + * {@inheritDoc} + */ + protected function setUp() + { + parent::setUp(); + + $this->em = $this->_getTestEntityManager(); + + $this->persister = new JoinedSubclassPersister( + $this->em, + $this->em->getClassMetadata('Doctrine\Tests\Models\JoinedInheritanceType\RootClass') + ); + } + + /** + * @group DDC-3470 + */ + public function testExecuteInsertsWillReturnEmptySetWithNoQueuedInserts() + { + $this->assertSame(array(), $this->persister->executeInserts()); + } +}