Skip to content

Commit fc19596

Browse files
committed
Require ORM 2.15
1 parent 4ba0137 commit fc19596

File tree

5 files changed

+11
-30
lines changed

5 files changed

+11
-30
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
"doctrine/collections": "^1.0|^2.0",
133133
"doctrine/data-fixtures": "^1.1",
134134
"doctrine/dbal": "^2.13.1|^3.0",
135-
"doctrine/orm": "^2.12",
135+
"doctrine/orm": "^2.15",
136136
"dragonmantank/cron-expression": "^3",
137137
"egulias/email-validator": "^2.1.10|^3.1|^4",
138138
"guzzlehttp/promises": "^1.4",
@@ -164,6 +164,7 @@
164164
"async-aws/core": "<1.5",
165165
"doctrine/annotations": "<1.13.1",
166166
"doctrine/dbal": "<2.13.1",
167+
"doctrine/orm": "<2.15",
167168
"egulias/email-validator": "~3.0.0",
168169
"masterminds/html5": "<2.6",
169170
"phpdocumentor/reflection-docblock": "<5.2",

src/Symfony/Bridge/Doctrine/Tests/DoctrineTestHelper.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,14 @@ public static function createTestEntityManager(Configuration $config = null): En
4545
];
4646

4747
$config ??= self::createTestConfiguration();
48-
49-
if (!(new \ReflectionMethod(EntityManager::class, '__construct'))->isPublic()) {
50-
return EntityManager::create($params, $config);
51-
}
52-
5348
$eventManager = new EventManager();
5449

5550
return new EntityManager(DriverManager::getConnection($params, $config, $eventManager), $config, $eventManager);
5651
}
5752

5853
public static function createTestConfiguration(): Configuration
5954
{
60-
$config = class_exists(ORMSetup::class) ? ORMSetup::createConfiguration(true) : new Configuration();
55+
$config = ORMSetup::createConfiguration(true);
6156
$config->setEntityNamespaces(['SymfonyTestsDoctrine' => 'Symfony\Bridge\Doctrine\Tests\Fixtures']);
6257
$config->setAutoGenerateProxyClasses(true);
6358
$config->setProxyDir(sys_get_temp_dir());

src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
1818
use Doctrine\DBAL\Types\Type as DBALType;
1919
use Doctrine\ORM\EntityManager;
20-
use Doctrine\ORM\Mapping\Column;
2120
use Doctrine\ORM\Mapping\Driver\AttributeDriver;
2221
use Doctrine\ORM\ORMSetup;
2322
use PHPUnit\Framework\TestCase;
@@ -35,20 +34,16 @@
3534
*/
3635
class DoctrineExtractorTest extends TestCase
3736
{
38-
private function createExtractor()
37+
private function createExtractor(): DoctrineExtractor
3938
{
4039
$config = ORMSetup::createConfiguration(true);
4140
$config->setMetadataDriverImpl(new AttributeDriver([__DIR__.'/../Tests/Fixtures' => 'Symfony\Bridge\Doctrine\Tests\Fixtures'], true));
4241
if (class_exists(DefaultSchemaManagerFactory::class)) {
4342
$config->setSchemaManagerFactory(new DefaultSchemaManagerFactory());
4443
}
4544

46-
if (!(new \ReflectionMethod(EntityManager::class, '__construct'))->isPublic()) {
47-
$entityManager = EntityManager::create(['driver' => 'pdo_sqlite'], $config);
48-
} else {
49-
$eventManager = new EventManager();
50-
$entityManager = new EntityManager(DriverManager::getConnection(['driver' => 'pdo_sqlite'], $config, $eventManager), $config, $eventManager);
51-
}
45+
$eventManager = new EventManager();
46+
$entityManager = new EntityManager(DriverManager::getConnection(['driver' => 'pdo_sqlite'], $config, $eventManager), $config, $eventManager);
5247

5348
if (!DBALType::hasType('foo')) {
5449
DBALType::addType('foo', 'Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineFooType');
@@ -136,19 +131,16 @@ public function testExtractWithEmbedded()
136131

137132
public function testExtractEnum()
138133
{
139-
if (!property_exists(Column::class, 'enumType')) {
140-
$this->markTestSkipped('The "enumType" requires doctrine/orm 2.11.');
141-
}
142134
$this->assertEquals([new Type(Type::BUILTIN_TYPE_OBJECT, false, EnumString::class)], $this->createExtractor()->getTypes(DoctrineEnum::class, 'enumString', []));
143135
$this->assertEquals([new Type(Type::BUILTIN_TYPE_OBJECT, false, EnumInt::class)], $this->createExtractor()->getTypes(DoctrineEnum::class, 'enumInt', []));
144136
$this->assertNull($this->createExtractor()->getTypes(DoctrineEnum::class, 'enumStringArray', []));
145137
$this->assertEquals([new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_OBJECT, false, EnumInt::class))], $this->createExtractor()->getTypes(DoctrineEnum::class, 'enumIntArray', []));
146138
$this->assertNull($this->createExtractor()->getTypes(DoctrineEnum::class, 'enumCustom', []));
147139
}
148140

149-
public static function typesProvider()
141+
public static function typesProvider(): array
150142
{
151-
$provider = [
143+
return [
152144
['id', [new Type(Type::BUILTIN_TYPE_INT)]],
153145
['guid', [new Type(Type::BUILTIN_TYPE_STRING)]],
154146
['bigint', [new Type(Type::BUILTIN_TYPE_STRING)]],
@@ -231,8 +223,6 @@ public static function typesProvider()
231223
)]],
232224
['json', null],
233225
];
234-
235-
return $provider;
236226
}
237227

238228
public function testGetPropertiesCatchException()

src/Symfony/Bridge/Doctrine/Tests/Validator/DoctrineLoaderTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Tests\Validator;
1313

14-
use Doctrine\ORM\Mapping\Column;
1514
use PHPUnit\Framework\TestCase;
1615
use Symfony\Bridge\Doctrine\Tests\DoctrineTestHelper;
1716
use Symfony\Bridge\Doctrine\Tests\Fixtures\BaseUser;
@@ -142,10 +141,6 @@ public function testLoadClassMetadata()
142141

143142
public function testExtractEnum()
144143
{
145-
if (!property_exists(Column::class, 'enumType')) {
146-
$this->markTestSkipped('The "enumType" requires doctrine/orm 2.11.');
147-
}
148-
149144
$validator = Validation::createValidatorBuilder()
150145
->addMethodMapping('loadValidatorMetadata')
151146
->enableAnnotationMapping(true)
@@ -195,7 +190,7 @@ public function testClassValidator(bool $expected, string $classValidatorRegexp
195190
$this->assertSame($expected, $doctrineLoader->loadClassMetadata($classMetadata));
196191
}
197192

198-
public static function regexpProvider()
193+
public static function regexpProvider(): array
199194
{
200195
return [
201196
[false, null],

src/Symfony/Bridge/Doctrine/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@
4747
"doctrine/collections": "^1.0|^2.0",
4848
"doctrine/data-fixtures": "^1.1",
4949
"doctrine/dbal": "^2.13.1|^3.0",
50-
"doctrine/orm": "^2.12",
50+
"doctrine/orm": "^2.15",
5151
"psr/log": "^1|^2|^3"
5252
},
5353
"conflict": {
5454
"doctrine/annotations": "<1.13.1",
5555
"doctrine/dbal": "<2.13.1",
5656
"doctrine/lexer": "<1.1",
57-
"doctrine/orm": "<2.12",
57+
"doctrine/orm": "<2.15",
5858
"symfony/cache": "<5.4",
5959
"symfony/dependency-injection": "<6.2",
6060
"symfony/form": "<5.4.21|>=6,<6.2.7",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy