Skip to content

Commit 35c01af

Browse files
authored
Merge pull request doctrine#2051 from doctrine/2.16.x
Merge 2.16.x up into 2.17.x
2 parents d36d5f7 + 753fe5d commit 35c01af

7 files changed

Lines changed: 24 additions & 13 deletions

File tree

phpunit.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
bootstrap="tests/bootstrap.php"
43
colors="true"
54
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
65
displayDetailsOnTestsThatTriggerDeprecations="true"

tests/Command/Proxy/InfoDoctrineCommandTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Symfony\Component\Console\Tester\CommandTester;
1212

1313
use function interface_exists;
14+
use function restore_exception_handler;
1415

1516
class InfoDoctrineCommandTest extends TestCase
1617
{
@@ -38,5 +39,7 @@ public function testExecute(): void
3839
'Found 3 mapped entities',
3940
$commandTester->getDisplay(),
4041
);
42+
43+
restore_exception_handler();
4144
}
4245
}

tests/DependencyInjection/Compiler/CacheCompatibilityPassTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use Symfony\Component\DependencyInjection\Definition;
2424

2525
use function interface_exists;
26+
use function restore_exception_handler;
2627

2728
class CacheCompatibilityPassTest extends TestCase
2829
{
@@ -82,6 +83,8 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
8283
})->boot();
8384

8485
$this->addToAssertionCount(1);
86+
87+
restore_exception_handler();
8588
}
8689

8790
#[DoesNotPerformAssertions]
@@ -108,6 +111,8 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
108111
});
109112
}
110113
})->boot();
114+
115+
restore_exception_handler();
111116
}
112117

113118
#[IgnoreDeprecations]
@@ -132,6 +137,8 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
132137
});
133138
}
134139
})->boot();
140+
141+
restore_exception_handler();
135142
}
136143
}
137144

tests/RegistryTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
use function assert;
2323
use function interface_exists;
24+
use function restore_exception_handler;
2425

2526
use const PHP_VERSION_ID;
2627

@@ -153,7 +154,7 @@ public function testReset(): void
153154
$registry->reset();
154155
}
155156

156-
/** @requires PHP < 8.4 */
157+
#[RequiresPhp('8.4')]
157158
public function testResetLazyObject(): void
158159
{
159160
if (! interface_exists(EntityManagerInterface::class) || ! interface_exists(LazyObjectInterface::class)) {
@@ -209,5 +210,7 @@ public function testIdentityMapsStayConsistentAfterReset(): void
209210
$this->assertFalse($repository->getEntityManager()->getUnitOfWork()->isEntityScheduled($entity));
210211

211212
$entityManager->flush();
213+
214+
restore_exception_handler();
212215
}
213216
}

tests/Repository/ServiceEntityRepositoryTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88
use Doctrine\ORM\EntityManagerInterface;
99
use Doctrine\Persistence\ManagerRegistry;
1010
use LogicException;
11+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
12+
use PHPUnit\Framework\Attributes\RequiresMethod;
13+
use PHPUnit\Framework\Attributes\RequiresPhp;
1114
use PHPUnit\Framework\TestCase;
1215
use Symfony\Component\VarExporter\LazyGhostTrait;
1316
use Symfony\Component\VarExporter\LazyObjectInterface;
17+
use Symfony\Component\VarExporter\ProxyHelper;
1418

1519
use function interface_exists;
1620

@@ -37,10 +41,9 @@ public function testConstructorThrowsExceptionWhenNoManagerFound(): void
3741
$repo->getClassName();
3842
}
3943

40-
/**
41-
* @requires function \Symfony\Component\VarExporter\ProxyHelper::generateLazyGhost
42-
* @requires PHP < 8.4
43-
*/
44+
#[IgnoreDeprecations]
45+
#[RequiresMethod(ProxyHelper::class, 'generateLazyGhost')]
46+
#[RequiresPhp('8.4')]
4447
public function testConstructInitializesWhenImplementingLazyObjectInterface(): void
4548
{
4649
$registry = $this->getMockBuilder(ManagerRegistry::class)->getMock();

tests/UrlOverrideTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1010

1111
use function array_intersect_key;
12+
use function restore_exception_handler;
1213

1314
class UrlOverrideTest extends TestCase
1415
{
@@ -30,6 +31,8 @@ public function testConnectionConfiguration(array $config, array $expectedParams
3031
$expectedParams,
3132
),
3233
);
34+
35+
restore_exception_handler();
3336
}
3437

3538
/** @return array<string, array{0: array<string, (bool|string|null)>, 1: array<string, (bool|string|null)>}> */

tests/bootstrap.php

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)