doctrine/DoctrineMongoDBBundle

Support when@test

pcmanprogrammeur opened this issue · 2 comments

Hello,

When we make tests, the "when@test" instruction is very usefull, in doctrine.yaml, to specify a different database when running tests :

when@test:
    doctrine:
        dbal:
            # "TEST_TOKEN" is typically set by ParaTest
            dbname_suffix: '_test%env(default::TEST_TOKEN)%'

It could be a good thing to make the same thing in this package like this in doctrine_mongodb.yaml :

when@test:
    doctrine_mongodb:
        document_managers:
            my_document_manager:
                database: '%env(resolve:URI_MONGO_DB)%_test'

What do you think about this feature ?

Thanks.

@pcmanprogrammeur this is strictly a feature of symfony/config (and it's environment handling) and has little to do with Doctrine bundles.

  1. Transferring issue to bundle as the configuration is happening here
  2. I haven't used the feature myself, but given what @Steveb-p is saying and giving https://symfony.com/blog/new-in-symfony-5-3-configure-multiple-environments-in-a-single-file a quick read it seems like there's nothing to do on our end, as the feature is handled entirely by Symfony