Skip to content

Commit 32da48c

Browse files
committed
Merge remote-tracking branch 'origin/2.16.x' into 2.17.x
2 parents 4427c3f + 35d5ef6 commit 32da48c

24 files changed

Lines changed: 226 additions & 169 deletions

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"symfony/var-exporter": "^6.4.1 || ^7.0.1",
6767
"symfony/web-profiler-bundle": "^6.4 || ^7.0",
6868
"symfony/yaml": "^6.4 || ^7.0",
69-
"twig/twig": "^2.13 || ^3.0.4"
69+
"twig/twig": "^2.14.7 || ^3.0.4"
7070
},
7171
"conflict": {
7272
"doctrine/annotations": ">=3.0",

tests/Builder/BundleConfigurationBuilder.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
namespace Doctrine\Bundle\DoctrineBundle\Tests\Builder;
66

7+
use Doctrine\Bundle\DoctrineBundle\Tests\DeprecationFreeConfig;
8+
9+
use function array_merge_recursive;
10+
711
class BundleConfigurationBuilder
812
{
913
/** @var array<string, mixed> */
@@ -71,9 +75,12 @@ public function addConnection(array $config): self
7175
}
7276

7377
/** @param array<string, mixed> $config */
74-
public function addEntityManager(array $config): self
78+
public function addEntityManager(array $config, bool $withMinimalOrmConfig = true): self
7579
{
7680
$this->configuration['orm'] = $config;
81+
if ($withMinimalOrmConfig) {
82+
$this->configuration = array_merge_recursive(DeprecationFreeConfig::get(), $this->configuration);
83+
}
7784

7885
return $this;
7986
}

tests/CacheSchemaSubscriberTest.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\CacheSchemaSubscriberPass;
88
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension;
9-
use Doctrine\ORM\Configuration;
109
use Doctrine\ORM\EntityManagerInterface;
1110
use Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension;
1211
use Symfony\Component\DependencyInjection\Alias;
@@ -16,11 +15,8 @@
1615
use Symfony\Component\DependencyInjection\Reference;
1716

1817
use function interface_exists;
19-
use function method_exists;
2018
use function sys_get_temp_dir;
2119

22-
use const PHP_VERSION_ID;
23-
2420
class CacheSchemaSubscriberTest extends TestCase
2521
{
2622
public function testSchemaSubscriberWiring(): void
@@ -68,15 +64,8 @@ public function testSchemaSubscriberWiring(): void
6864
$extension = new DoctrineExtension();
6965
$container->registerExtension($extension);
7066
$extension->load([
71-
[
72-
'dbal' => [],
73-
'orm' => [
74-
'controller_resolver' => ['auto_mapping' => false],
75-
/* @phpstan-ignore function.alreadyNarrowedType */
76-
] + (method_exists(Configuration::class, 'enableNativeLazyObjects') ? [
77-
'enable_native_lazy_objects' => PHP_VERSION_ID >= 80400,
78-
] : ['enable_lazy_ghost_objects' => true]),
79-
],
67+
DeprecationFreeConfig::get(),
68+
['dbal' => []],
8069
], $container);
8170

8271
$container->setAlias('test_subscriber_alias', new Alias('doctrine.orm.listeners.doctrine_dbal_cache_adapter_schema_listener', true));

tests/Command/ImportMappingDoctrineCommandTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Doctrine\ORM\EntityManagerInterface;
99
use Doctrine\ORM\Tools\Export\ClassMetadataExporter;
1010
use InvalidArgumentException;
11-
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
11+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1212
use PHPUnit\Framework\TestCase;
1313
use Symfony\Bundle\FrameworkBundle\Console\Application;
1414
use Symfony\Component\Console\Tester\CommandTester;
@@ -68,7 +68,7 @@ protected function tearDown(): void
6868
unset($this->kernel, $this->commandTester);
6969
}
7070

71-
#[WithoutErrorHandler]
71+
#[IgnoreDeprecations]
7272
public function testExecuteXmlWithBundle(): void
7373
{
7474
$this->commandTester->execute(['name' => 'ImportMappingTestFooBundle']);
@@ -82,7 +82,7 @@ public function testExecuteXmlWithBundle(): void
8282
);
8383
}
8484

85-
#[WithoutErrorHandler]
85+
#[IgnoreDeprecations]
8686
public function testExecuteAnnotationsWithBundle(): void
8787
{
8888
$this->commandTester->execute([
@@ -99,15 +99,15 @@ public function testExecuteAnnotationsWithBundle(): void
9999
);
100100
}
101101

102-
#[WithoutErrorHandler]
102+
#[IgnoreDeprecations]
103103
public function testExecuteThrowsExceptionWithNamespaceAndNoPath(): void
104104
{
105105
$this->expectException(InvalidArgumentException::class);
106106
$this->expectExceptionMessage('The --path option is required');
107107
$this->commandTester->execute(['name' => 'Some\Namespace']);
108108
}
109109

110-
#[WithoutErrorHandler]
110+
#[IgnoreDeprecations]
111111
public function testExecuteXmlWithNamespace(): void
112112
{
113113
$this->commandTester->execute([
@@ -124,7 +124,7 @@ public function testExecuteXmlWithNamespace(): void
124124
);
125125
}
126126

127-
#[WithoutErrorHandler]
127+
#[IgnoreDeprecations]
128128
public function testExecuteAnnotationsWithNamespace(): void
129129
{
130130
$this->commandTester->execute([

tests/ConnectionFactoryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
1212
use Doctrine\Deprecations\PHPUnit\VerifyDeprecations;
1313
use InvalidArgumentException;
14-
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
14+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1515

1616
use function array_intersect_key;
1717
use function method_exists;
@@ -66,7 +66,7 @@ public function testDefaultCollationMySql(): void
6666
);
6767
}
6868

69-
#[WithoutErrorHandler]
69+
#[IgnoreDeprecations]
7070
public function testCollateMapsToCollationForMySql(): void
7171
{
7272
$factory = new ConnectionFactory([]);
@@ -90,7 +90,7 @@ public function testCollateMapsToCollationForMySql(): void
9090
);
9191
}
9292

93-
#[WithoutErrorHandler]
93+
#[IgnoreDeprecations]
9494
public function testConnectionOverrideOptions(): void
9595
{
9696
$params = [
@@ -175,7 +175,7 @@ public function testItThrowsWhenPassingMappingTypesTwice(): void
175175
(new ConnectionFactory())->createConnection(['driver' => 'pdo_sqlite'], null, [], []);
176176
}
177177

178-
#[WithoutErrorHandler]
178+
#[IgnoreDeprecations]
179179
public function testPassingMappingTypesAsFourthArgumentIsDeprecatedWithDbal4(): void
180180
{
181181
if (method_exists(Connection::class, 'getEventManager')) {

0 commit comments

Comments
 (0)