diff --git a/tests/Doctrine/Tests/ORM/ConfigurationTest.php b/tests/Doctrine/Tests/ORM/ConfigurationTest.php index df74c6df2..ab657c5fd 100644 --- a/tests/Doctrine/Tests/ORM/ConfigurationTest.php +++ b/tests/Doctrine/Tests/ORM/ConfigurationTest.php @@ -179,6 +179,8 @@ class ConfigurationTest extends TestCase { $this->setProductionSettings(); $this->configuration->ensureProductionSettings(); + + $this->addToAssertionCount(1); } public function testEnsureProductionSettingsQueryCache() diff --git a/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php b/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php index 02ed0a356..c94d3d73d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php @@ -301,6 +301,7 @@ class ClassTableInheritanceTest extends OrmFunctionalTestCase ->setParameter(1, 'IT') ->execute(); + $this->addToAssertionCount(1); } /** diff --git a/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php b/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php index dc27d45be..d515e95bf 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php @@ -37,6 +37,8 @@ class LockTest extends OrmFunctionalTestCase $this->_em->flush(); $this->_em->lock($article, LockMode::OPTIMISTIC, $article->version); + + $this->addToAssertionCount(1); } /** diff --git a/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php b/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php index 3681ed95e..8b8113b6a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php @@ -178,6 +178,8 @@ class OptimisticTest extends OrmFunctionalTestCase $proxy = $this->_em->getReference(OptimisticStandard::class, $test->id); $this->_em->lock($proxy, LockMode::OPTIMISTIC, 1); + + $this->addToAssertionCount(1); } public function testOptimisticTimestampSetsDefaultValue() diff --git a/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php b/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php index b611c7125..0fd2b4745 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php @@ -36,6 +36,8 @@ class PersistentObjectTest extends OrmFunctionalTestCase $this->_em->persist($entity); $this->_em->flush(); + + $this->addToAssertionCount(1); } public function testFind() diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3170Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3170Test.php index 88e3727d2..0ef1caee8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3170Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3170Test.php @@ -46,27 +46,17 @@ class DDC3170Test extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->flush(); $this->_em->clear(); - try { - $this->_em->createQueryBuilder() - ->select('p') - ->from(DDC3170ProductJoined::class, 'p') - ->getQuery() - ->getResult(AbstractQuery::HYDRATE_SIMPLEOBJECT); - } catch (HydrationException $e) // Thrown by SimpleObjectHydrator - { - $this->fail('Failed correct mapping of discriminator column when using simple object hydration and class table inheritance'); - } + $this->_em->createQueryBuilder() + ->select('p') + ->from(DDC3170ProductJoined::class, 'p') + ->getQuery() + ->getResult(AbstractQuery::HYDRATE_SIMPLEOBJECT); - try { - $this->_em->createQueryBuilder() - ->select('p') - ->from(DDC3170ProductSingleTable::class, 'p') - ->getQuery() - ->getResult(AbstractQuery::HYDRATE_SIMPLEOBJECT); - } catch (HydrationException $e) // Thrown by SimpleObjectHydrator - { - $this->fail('Failed correct mapping of discriminator column when using simple object hydration and single table inheritance'); - } + $this->_em->createQueryBuilder() + ->select('p') + ->from(DDC3170ProductSingleTable::class, 'p') + ->getQuery() + ->getResult(AbstractQuery::HYDRATE_SIMPLEOBJECT); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php index aa50f2cdb..7361bc4f4 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php @@ -23,6 +23,8 @@ class DDC588Test extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->flush(); // Following should not result in exception $this->_em->refresh($site); + + $this->addToAssertionCount(1); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php index bc465db92..8adcb0879 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php @@ -68,6 +68,7 @@ class DDC742Test extends \Doctrine\Tests\OrmFunctionalTestCase $user->favoriteComments->add($this->_em->find(DDC742Comment::class, $comment3->id)); $this->_em->flush(); + $this->addToAssertionCount(1); } } diff --git a/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php b/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php index ea2826309..955a5f43d 100644 --- a/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php @@ -24,64 +24,28 @@ class SchemaValidatorTest extends OrmTestCase $this->validator = new SchemaValidator($this->em); } - public function testCmsModelSet() + /** + * @dataProvider modelSetProvider + */ + public function testCmsModelSet(string $path) { - $this->em->getConfiguration()->getMetadataDriverImpl()->addPaths( - [ - __DIR__ . "/../../Models/CMS" - ] - ); + $this->em->getConfiguration() + ->getMetadataDriverImpl() + ->addPaths([$path]); + $this->validator->validateMapping(); } - public function testCompanyModelSet() + public function modelSetProvider(): array { - $this->em->getConfiguration()->getMetadataDriverImpl()->addPaths( - [ - __DIR__ . "/../../Models/Company" - ] - ); - $this->validator->validateMapping(); - } - - public function testECommerceModelSet() - { - $this->em->getConfiguration()->getMetadataDriverImpl()->addPaths( - [ - __DIR__ . "/../../Models/ECommerce" - ] - ); - $this->validator->validateMapping(); - } - - public function testForumModelSet() - { - $this->em->getConfiguration()->getMetadataDriverImpl()->addPaths( - [ - __DIR__ . "/../../Models/Forum" - ] - ); - $this->validator->validateMapping(); - } - - public function testNavigationModelSet() - { - $this->em->getConfiguration()->getMetadataDriverImpl()->addPaths( - [ - __DIR__ . "/../../Models/Navigation" - ] - ); - $this->validator->validateMapping(); - } - - public function testRoutingModelSet() - { - $this->em->getConfiguration()->getMetadataDriverImpl()->addPaths( - [ - __DIR__ . "/../../Models/Routing" - ] - ); - $this->validator->validateMapping(); + return [ + 'cms' => [__DIR__ . '/../../Models/CMS'], + 'company' => [__DIR__ . '/../../Models/Company'], + 'ecommerce' => [__DIR__ . '/../../Models/ECommerce'], + 'forum' => [__DIR__ . '/../../Models/Forum'], + 'navigation' => [__DIR__ . '/../../Models/Navigation'], + 'routing' => [__DIR__ . '/../../Models/Routing'], + ]; } /**