From 8f15c5e90566a43a3414240b65b3edb9c5f8cc7d Mon Sep 17 00:00:00 2001 From: Martin Prebio Date: Wed, 31 Dec 2014 01:28:05 +0100 Subject: [PATCH 1/5] Consistent return type confirming with interface --- lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); From e2b34ff5d2688a8ee5a72bad617dbfb5384e8c6e Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Wed, 31 Dec 2014 09:44:39 +0100 Subject: [PATCH 2/5] #1235 DDC-3470 - joined subclass persister empty `executeInserts()` method return type test --- .../JoinedSubclassPersisterTest.php | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php diff --git a/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php b/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php new file mode 100644 index 000000000..78e47e7f4 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php @@ -0,0 +1,39 @@ +em = $this->_getTestEntityManager(); + + $this->persister = new JoinedSubclassPersister( + $this->em, + $this->em->getClassMetadata('Doctrine\Tests\Models\JoinedInheritanceType\RootClass') + ); + } + + public function testExecuteInsertsWillReturnEmptySetWithNoQueuedInserts() + { + $this->assertSame(array(), $this->persister->executeInserts()); + } +} From 74f00327bdd87ea3bc0d2a2eab00516fe4f6e048 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Wed, 31 Dec 2014 09:45:33 +0100 Subject: [PATCH 3/5] #1235 DDC-3470 - adding `@group` annotation for newly introduced test cases --- .../Tests/ORM/Persisters/JoinedSubclassPersisterTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php b/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php index 78e47e7f4..9b5e233dc 100644 --- a/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php @@ -32,6 +32,9 @@ class JoinedSubClassPersisterTest extends OrmTestCase ); } + /** + * @group DDC-3470 + */ public function testExecuteInsertsWillReturnEmptySetWithNoQueuedInserts() { $this->assertSame(array(), $this->persister->executeInserts()); From a93e5fa1c204d98fe400d03a9596dd74f1af5c3a Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Wed, 31 Dec 2014 09:45:46 +0100 Subject: [PATCH 4/5] #1235 DDC-3470 - license headers --- .../Persisters/JoinedSubclassPersisterTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php b/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php index 9b5e233dc..e083075f6 100644 --- a/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php @@ -1,4 +1,21 @@ . + */ namespace Doctrine\Tests\ORM\Persisters; From 0f165bce5061d72f128934d154d7c9b3a8478b80 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Wed, 31 Dec 2014 09:46:19 +0100 Subject: [PATCH 5/5] #1235 DDC-3470 - coverage annotations --- .../Tests/ORM/Persisters/JoinedSubclassPersisterTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php b/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php index e083075f6..6c3bce3cf 100644 --- a/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php @@ -22,6 +22,11 @@ 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 { /**