Skip to content

Commit 3dd0489

Browse files
authored
Fix test environment for doctrine-common 3.0 (#33)
Remove references to Doctrine Annotations, which we aren't using in this repo, we use XML mappings instead of annotations for our entities. Remove misleading comment from AddressChangeContextFactory (which only applies if we're using annotations). This was probably copy-pasted. At some point in the past, doctrine ORM switched from doctrine-common 2.x to 3.x. This got rid of the doctrine-annotations dependency, making our CI fail.
1 parent 7e8f134 commit 3dd0489

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,10 @@
3333
"psr-4": {
3434
"WMDE\\Fundraising\\AddressChangeContext\\Tests\\": "tests/"
3535
}
36+
},
37+
"config": {
38+
"allow-plugins": {
39+
"composer/package-versions-deprecated": true
40+
}
3641
}
3742
}

src/AddressChangeContextFactory.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ class AddressChangeContextFactory {
2121
private const DOCTRINE_CLASS_MAPPING_DIRECTORY = __DIR__ . '/../config/DoctrineClassMapping';
2222

2323
public function newMappingDriver(): MappingDriver {
24-
// We're only calling this for the side effect of adding Mapping/Driver/DoctrineAnnotations.php
25-
// to the AnnotationRegistry. When AnnotationRegistry is deprecated with Doctrine Annotations 2.0,
26-
// use $this->annotationReader instead
2724
return new XmlDriver( self::DOCTRINE_CLASS_MAPPING_DIRECTORY );
2825
}
2926

tests/TestAddressChangeContextFactory.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace WMDE\Fundraising\AddressChangeContext\Tests;
66

7-
use Doctrine\Common\Annotations\AnnotationRegistry;
87
use Doctrine\DBAL\Connection;
98
use Doctrine\DBAL\DriverManager;
109
use Doctrine\ORM\Configuration;
@@ -34,7 +33,6 @@ public function __construct( array $config, Configuration $doctrineConfig ) {
3433

3534
public function getEntityManager(): EntityManager {
3635
if ( $this->entityManager === null ) {
37-
AnnotationRegistry::registerLoader( 'class_exists' );
3836

3937
$this->doctrineConfig->setMetadataDriverImpl( $this->factory->newMappingDriver() );
4038

0 commit comments

Comments
 (0)