Skip to content

Commit ca3678d

Browse files
committed
Improve deprecation layers in tests
1 parent 28fb80a commit ca3678d

File tree

10 files changed

+14
-13
lines changed

10 files changed

+14
-13
lines changed

Tests/DependencyInjection/AbstractDoctrineExtensionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,7 @@ public function testAddCustomHydrationMode(): void
874874
$this->assertDICDefinitionMethodCallOnce($definition, 'addCustomHydrationMode', ['test_hydrator', TestHydrator::class]);
875875
}
876876

877+
/** @requires PHP 8.1 */
877878
public function testAddFilter(): void
878879
{
879880
if (! interface_exists(EntityManagerInterface::class)) {

Tests/DependencyInjection/Compiler/IdGeneratorPassTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ public function testRepositoryServiceWiring(): void
9393
'framework' => [
9494
'http_method_override' => false,
9595
'annotations' => [
96-
'enabled' => class_exists(AnnotationReader::class) && Kernel::VERSION_ID < 64000,
96+
'enabled' => class_exists(AnnotationReader::class) && Kernel::VERSION_ID < 60400,
9797
],
9898
'php_errors' => ['log' => true],
99-
] + (Kernel::VERSION_ID >= 62000 ? ['handle_all_throwables' => true] : []),
99+
] + (Kernel::VERSION_ID >= 60200 ? ['handle_all_throwables' => true] : []),
100100
], $container);
101101

102102
$extension = new DoctrineExtension();
@@ -111,6 +111,7 @@ public function testRepositoryServiceWiring(): void
111111
'orm' => [
112112
'mappings' => $mappings,
113113
'report_fields_where_declared' => true,
114+
'enable_lazy_ghost_objects' => PHP_VERSION_ID >= 80100,
114115
],
115116
],
116117
], $container);

Tests/DependencyInjection/Fixtures/TestKernel.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
4242
$container->loadFromExtension('framework', [
4343
'secret' => 'F00',
4444
'http_method_override' => false,
45-
'annotations' => class_exists(Annotation::class) && Kernel::VERSION_ID <= 64000,
45+
'annotations' => class_exists(Annotation::class) && Kernel::VERSION_ID <= 60400,
4646
'php_errors' => ['log' => true],
47-
] + (Kernel::VERSION_ID >= 62000 ? ['handle_all_throwables' => true] : []));
47+
] + (Kernel::VERSION_ID >= 60200 ? ['handle_all_throwables' => true] : []));
4848
$container->loadFromExtension('doctrine', [
4949
'dbal' => [
5050
'driver' => 'pdo_sqlite',
@@ -53,6 +53,7 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
5353
'orm' => [
5454
'report_fields_where_declared' => true,
5555
'auto_generate_proxy_classes' => true,
56+
'enable_lazy_ghost_objects' => PHP_VERSION_ID >= 80100,
5657
'mappings' => [
5758
'RepositoryServiceBundle' => [
5859
'type' => PHP_VERSION_ID >= 80000 ? 'attribute' : 'annotation',

Tests/DependencyInjection/Fixtures/config/xml/orm_filters.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<connection name="default" dbname="db" />
1212
</dbal>
1313

14-
<orm>
14+
<orm enable-lazy-ghost-objects="true">
1515
<filter name="soft_delete" enabled="true" >Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection\TestFilter</filter>
1616
<filter name="myFilter" enabled="true" class="Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection\TestFilter">
1717
<parameter name="myParameter">myValue</parameter>

Tests/DependencyInjection/Fixtures/config/yml/orm_filters.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ doctrine:
66
dbname: db
77

88
orm:
9+
enable_lazy_ghost_objects: true
910
filters:
1011
soft_delete:
1112
class: Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection\TestFilter

Tests/LockStoreSchemaListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testLockStoreSchemaSubscriberWiring(array $config, int $expected
5555
$extension->load(
5656
[
5757
'framework' => ['http_method_override' => false, 'php_errors' => ['log' => true]]
58-
+ (Kernel::VERSION_ID >= 62000 ? ['handle_all_throwables' => true] : []) + $config,
58+
+ (Kernel::VERSION_ID >= 60200 ? ['handle_all_throwables' => true] : []) + $config,
5959
],
6060
$container
6161
);

Tests/ServiceRepositoryTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ public function testRepositoryServiceWiring(): void
7474
'http_method_override' => false,
7575
'php_errors' => ['log' => true],
7676
'annotations' => [
77-
'enabled' => class_exists(AnnotationReader::class) && Kernel::VERSION_ID < 64000,
77+
'enabled' => class_exists(AnnotationReader::class) && Kernel::VERSION_ID < 60400,
7878
],
79-
] + (Kernel::VERSION_ID >= 62000 ? ['handle_all_throwables' => true] : []),
79+
] + (Kernel::VERSION_ID >= 60200 ? ['handle_all_throwables' => true] : []),
8080
], $container);
8181

8282
$extension = new DoctrineExtension();
@@ -90,6 +90,7 @@ public function testRepositoryServiceWiring(): void
9090
],
9191
'orm' => [
9292
'report_fields_where_declared' => true,
93+
'enable_lazy_ghost_objects' => PHP_VERSION_ID >= 80100,
9394
'mappings' => [
9495
'RepositoryServiceBundle' => [
9596
'type' => PHP_VERSION_ID >= 80000 ? 'attribute' : 'annotation',

Tests/baseline-ignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"symfony/string": "^5.4 || ^6.0",
6161
"symfony/twig-bridge": "^5.4 || ^6.0",
6262
"symfony/validator": "^5.4 || ^6.0",
63+
"symfony/var-exporter": "^5.4 || ^6.2 || ^7.0",
6364
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
6465
"symfony/yaml": "^5.4 || ^6.0",
6566
"twig/twig": "^1.34 || ^2.12 || ^3.0",

phpunit.xml.dist

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
</testsuite>
88
</testsuites>
99

10-
<php>
11-
<env name="SYMFONY_DEPRECATIONS_HELPER" value="ignoreFile=./Tests/baseline-ignore"/>
12-
</php>
13-
1410
<filter>
1511
<whitelist>
1612
<directory>.</directory>

0 commit comments

Comments
 (0)