doctrine / data-fixtures

Doctrine2 ORM Data Fixtures Extensions
http://www.doctrine-project.org
MIT License
2.78k stars 224 forks source link

Difficulty in running the MongoDBPurgerTest #263

Closed redthor closed 7 years ago

redthor commented 7 years ago

I tried running tests/Doctrine/Tests/Common/DataFixtures/Purger/MongoDBPurgerTest.php but it has:

        if (!class_exists('Doctrine\ODM\MongoDB\DocumentManager')) {
            $this->markTestSkipped('Missing doctrine/mongodb-odm');
        }

So I tried:

composer require alcaeus/mongo-php-adapter doctrine/mongodb-odm --ignore-platform-reqs

But no joy:

1) Doctrine\Tests\Common\DataFixtures\Purger\MongoDBPurgerTest::testPurgeKeepsIndices
Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@Doctrine\ODM\MongoDB\Mapping\Annotations\String" in property Doctrine\Tests\Common\DataFixtures\TestDocument\Role::$name does not exist, or could not be auto-loaded.

./data-fixtures/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:54
./data-fixtures/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:734
./data-fixtures/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:663
./data-fixtures/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:354
./data-fixtures/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php:252
./data-fixtures/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php:156
./data-fixtures/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php:159
./data-fixtures/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:332
./data-fixtures/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:225
./data-fixtures/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/DocumentManager.php:333
./data-fixtures/tests/Doctrine/Tests/Common/DataFixtures/Purger/MongoDBPurgerTest.php:51

Can we have some README advice about how to get this test to run? Thanks.

alcaeus commented 7 years ago

@redthor Ah, looks like the test still used one of our deprecated type annotations (String). These are not loaded in PHP 7. I've created a PR to fix this and also changed the build file to test ODM with PHP 7.