Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9f5c005

Browse filesBrowse files
[PhpUnitBridge] Revert "minor #48725 Remove calls to AnnotationRegistry::registerLoader()"
1 parent f3fc6d7 commit 9f5c005
Copy full SHA for 9f5c005

File tree

4 files changed

+19
-2
lines changed
Filter options

4 files changed

+19
-2
lines changed

‎composer.json

Copy file name to clipboardExpand all lines: composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
"doctrine/collections": "^1.0|^2.0",
129129
"doctrine/data-fixtures": "^1.1",
130130
"doctrine/dbal": "^2.13.1|^3.0",
131-
"doctrine/orm": "^2.12",
131+
"doctrine/orm": "^2.7.4",
132132
"egulias/email-validator": "^2.1.10|^3.1",
133133
"guzzlehttp/promises": "^1.4",
134134
"league/html-to-markdown": "^5.0",

‎src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bridge\PhpUnit\Legacy;
1313

14+
use Doctrine\Common\Annotations\AnnotationRegistry;
1415
use PHPUnit\Framework\AssertionFailedError;
1516
use PHPUnit\Framework\RiskyTestError;
1617
use PHPUnit\Framework\TestCase;
@@ -129,6 +130,14 @@ public function startTestSuite($suite)
129130
echo "Testing $suiteName\n";
130131
$this->state = 0;
131132

133+
if (!class_exists(AnnotationRegistry::class, false) && class_exists(AnnotationRegistry::class)) {
134+
if (method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) {
135+
AnnotationRegistry::registerUniqueLoader('class_exists');
136+
} elseif (method_exists(AnnotationRegistry::class, 'registerLoader')) {
137+
AnnotationRegistry::registerLoader('class_exists');
138+
}
139+
}
140+
132141
if ($this->skippedFile = getenv('SYMFONY_PHPUNIT_SKIPPED_TESTS')) {
133142
$this->state = 1;
134143

‎src/Symfony/Bridge/PhpUnit/bootstrap.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/bootstrap.php
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12+
use Doctrine\Common\Annotations\AnnotationRegistry;
1213
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
1314

1415
// Detect if we need to serialize deprecations to a file.
@@ -26,6 +27,14 @@
2627
// Enforce a consistent locale
2728
setlocale(\LC_ALL, 'C');
2829

30+
if (!class_exists(AnnotationRegistry::class, false) && class_exists(AnnotationRegistry::class)) {
31+
if (method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) {
32+
AnnotationRegistry::registerUniqueLoader('class_exists');
33+
} elseif (method_exists(AnnotationRegistry::class, 'registerLoader')) {
34+
AnnotationRegistry::registerLoader('class_exists');
35+
}
36+
}
37+
2938
if ('disabled' !== getenv('SYMFONY_DEPRECATIONS_HELPER')) {
3039
DeprecationErrorHandler::register(getenv('SYMFONY_DEPRECATIONS_HELPER'));
3140
}

‎src/Symfony/Bridge/PhpUnit/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/composer.json
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"symfony/error-handler": "For tracking deprecated interfaces usages at runtime with DebugClassLoader"
2929
},
3030
"conflict": {
31-
"doctrine/annotations": "<1.10",
3231
"phpunit/phpunit": "<7.5|9.1.2"
3332
},
3433
"autoload": {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.