doctrine / data-fixtures

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

Running tests: Cannot use 'String' as class name as it is reserved #262

Closed redthor closed 7 years ago

redthor commented 7 years ago

Hi, I'm looking into another issue but when I attempted to run the tests they exited with:

Fatal error:  Cannot use 'String' as class name as it is reserved in ./vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/String.php on line 26

I should add:

 >php -v
PHP 7.1.6-2+0~20170614060700.1+jessie~1.gbp831871 (cli) (built: Jun 14 2017 06:28:54) ( NTS )
redthor commented 7 years ago

Actually, I just noticed that it picked up that file from completely outside of the data-fixtures directory when running phpunit tests in /data-fixtures directory... so the actual error might be that AnnotationDriver is over zealous - it is scanning all sorts of directories..

redthor commented 7 years ago

Urgh, sorry, it was a stupid bash alias error, I fixed it by running

./vendor/phpunit/phpunit/phpunit tests