dmaicher/doctrine-test-bundle

Cannot use outside symfony

ktom opened this issue · 3 comments

ktom commented

Hello,

I discovered this bundle while looking into best practices around testing with a db and fixtures, but the package in which i would like to use it does not use symfony and I would like to avoid the dependency.

Would you consider opening a new repo with the main classes in it (i guess Behat, Doctrine and PhpUnit folders) and requiring this new package here ?

I'd gladly help on the work if you decide to go that way

Thanks for reading !

I personally don't really want to maintain 2 packages as I don't need this outside of Symfony apps.

Could you maybe explain how you would use this without Symfony or DoctrineBundle? A lot in this bundle is based on integrating this as a Symfony bundle.

For example the connection factory extends the one provided by DoctrineBundle: https://github.com/dmaicher/doctrine-test-bundle/blob/master/src/DAMA/DoctrineTestBundle/Doctrine/DBAL/StaticConnectionFactory.php#L5

So you would need your own logic of creating connections then?

ktom commented

Hello,

Thank you for the feedback. I understand the burden on maintenance.
Sorry i didn't notice the dependency between the factory and the one from doctrine bundle.

I'm trying to build a package that could be used outside of symfony projects, but using doctrine for persistence. The idea was to use your tool to improve the testing of this package.

And yes, indeed, i'll need to handle my own connections and i guess the logic to do the "plumbing" ( DoctrineTestCompilerPass ?) would need to be done manually or with some kind of helper methods.

Anyway it's kind of a "research" personnal project i'm working on so no big deal ^^ i can easily implement my own simple transaction/rollback mechanism for the conveniance asi don't need so much optimisation for now :p

Ok thanks for the context.

I would close this for now. Maybe you can fork this repo and try using it for your project and report back here how it went?