From 07ee9a78a9182f52ecf88ac61e54d643ba3b952f Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Sat, 9 Sep 2017 10:03:21 +0300 Subject: [PATCH] Move UUID type initialization to setUpBeforeClass --- phpunit.xml.dist | 2 +- .../DataFixtures/ProxyReferenceRepositoryTest.php | 10 ++++++++++ tests/bootstrap.php | 7 ------- 3 files changed, 11 insertions(+), 8 deletions(-) delete mode 100644 tests/bootstrap.php diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 72acf5f8..885d4308 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,7 +8,7 @@ convertWarningsToExceptions="true" stopOnFailure="false" syntaxCheck="false" - bootstrap="tests/bootstrap.php" + bootstrap="vendor/autoload.php" > diff --git a/tests/Doctrine/Tests/Common/DataFixtures/ProxyReferenceRepositoryTest.php b/tests/Doctrine/Tests/Common/DataFixtures/ProxyReferenceRepositoryTest.php index 9be21745..698131e6 100644 --- a/tests/Doctrine/Tests/Common/DataFixtures/ProxyReferenceRepositoryTest.php +++ b/tests/Doctrine/Tests/Common/DataFixtures/ProxyReferenceRepositoryTest.php @@ -26,6 +26,8 @@ use Doctrine\Tests\Common\DataFixtures\TestEntity\Role; use Doctrine\Tests\Common\DataFixtures\TestValueObjects\Uuid; use Doctrine\Tests\Common\DataFixtures\TestEntity\Link; +use Doctrine\DBAL\Types\Type; +use Doctrine\Tests\Common\DataFixtures\TestTypes\UuidType; /** * Test ProxyReferenceRepository. @@ -38,6 +40,14 @@ class ProxyReferenceRepositoryTest extends BaseTest const TEST_ENTITY_ROLE = Role::class; const TEST_ENTITY_LINK = Link::class; + public static function setUpBeforeClass() { + parent::setUpBeforeClass(); + + if (!Type::hasType('uuid')) { + Type::addType('uuid', UuidType::class); + } + } + public function testReferenceEntry() { $em = $this->getMockAnnotationReaderEntityManager(); diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index 52b5cf9a..00000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,7 +0,0 @@ -