Skip to content

Commit 9069d06

Browse files
committed
Fix tests to run with Doctrine Common AnnotationRegistry
1 parent d5c1bbe commit 9069d06

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

autoload.php.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require_once __DIR__.'/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
44

55
use Symfony\Component\ClassLoader\UniversalClassLoader;
6+
use Doctrine\Common\Annotations\AnnotationRegistry;
67

78
$loader = new UniversalClassLoader();
89
$loader->registerNamespaces(array(
@@ -21,6 +22,12 @@ $loader->registerPrefixFallbacks(array(
2122
));
2223
$loader->register();
2324

25+
AnnotationRegistry::registerLoader(function($class) use ($loader) {
26+
$loader->loadClass($class);
27+
return class_exists($class, false);
28+
});
29+
AnnotationRegistry::registerFile(__DIR__.'/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
30+
2431
if (is_file(__DIR__.'/vendor/swiftmailer/lib/classes/Swift.php')) {
2532
require_once __DIR__.'/vendor/swiftmailer/lib/classes/Swift.php';
2633
Swift::registerAutoload(__DIR__.'/vendor/swiftmailer/lib/swift_init.php');

tests/Symfony/Tests/Component/Validator/Mapping/Loader/AnnotationLoaderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ protected function setUp()
3636
public function testLoadClassMetadataReturnsTrueIfSuccessful()
3737
{
3838
$reader = new AnnotationReader();
39-
$reader->setAutoloadAnnotations(true);
4039
$loader = new AnnotationLoader($reader);
4140
$metadata = new ClassMetadata('Symfony\Tests\Component\Validator\Fixtures\Entity');
4241

0 commit comments

Comments
 (0)