Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Failures with doctrine/phpcr-odm > 2.00 #1544

Open
idbentley opened this issue Jun 10, 2024 · 1 comment
Open

Test Failures with doctrine/phpcr-odm > 2.00 #1544

idbentley opened this issue Jun 10, 2024 · 1 comment

Comments

@idbentley
Copy link
Contributor

idbentley commented Jun 10, 2024

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no

Steps required to reproduce the problem

  1. Pull schmittjoh/serializer
  2. composer install
  3. ./vendor/bin/phpunit tests

Expected Result

  • Tests should pass

Actual Result

  • Three tests fail with the following output:
1) JMS\Serializer\Tests\Metadata\Driver\DoctrinePHPCRDriverTest::testTypelessPropertyIsGivenTypeFromDoctrineMetadata
Error: Class "Doctrine\ODM\PHPCR\Mapping\Driver\AnnotationDriver" not found

/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:105
/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:123
/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:35
/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:40

2) JMS\Serializer\Tests\Metadata\Driver\DoctrinePHPCRDriverTest::testSingleValuedAssociationIsProperlyHinted
Error: Class "Doctrine\ODM\PHPCR\Mapping\Driver\AnnotationDriver" not found

/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:105
/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:123
/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:35
/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:49

3) JMS\Serializer\Tests\Metadata\Driver\DoctrinePHPCRDriverTest::testMultiValuedAssociationIsProperlyHinted
Error: Class "Doctrine\ODM\PHPCR\Mapping\Driver\AnnotationDriver" not found

/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:105
/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:123
/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:35
/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:58

4) JMS\Serializer\Tests\Metadata\Driver\DoctrinePHPCRDriverTest::testTypeGuessByDoctrineIsOverwrittenByDelegateDriver
Error: Class "Doctrine\ODM\PHPCR\Mapping\Driver\AnnotationDriver" not found

/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:105
/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:123
/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:35
/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:73

5) JMS\Serializer\Tests\Metadata\Driver\DoctrinePHPCRDriverTest::testNonDoctrineDocumentClassIsNotModified
Error: Class "Doctrine\ODM\PHPCR\Mapping\Driver\AnnotationDriver" not found

/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:105
/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:123
/home/ian/development/speakeasy/serializer/tests/Metadata/Driver/DoctrinePHPCRDriverTest.php:89

Workaround

Doctrine\ODM\PHPCR\Mapping\Driver\AnnotationDriver is removed in phpcr-odm > 2.0. I updated the composer.json to require a 1.x version:

-    "doctrine/phpcr-odm": "^1.5.2 || ^2.0",
+     "doctrine/phpcr-odm": "^1.5.2",

A better fix would support 1.x and 2.x releases from phpcr-odm.

Changelog:

Removed annotation mappings. Use attributes (or XML or YAML) instead.

@scyzoryck
Copy link
Collaborator

Hmm. I will take a look later today at it.
For other tests we took approach to use attribution driver if AnnotationDriver is not available ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants