ORMPurger::PURGE_MODE_TRUNCATE tries to find tables in wrong database in case of multiple databases and if bundles are shared between multiple entity manager.
Hi, I have config something like below, to use AcmeUsersBundle entities in AcmeDemoBundle I have added AcmeUsersBundle under default.
default:
connection: default
mappings:
AcmeDemoBundle : ~
AcmeUsersBundle : ~
users:
connection: ownership
mappings:
AcmeUsersBundle : ~
this->loadFixtures($classes, null, 'doctrine', ORMPurger::PURGE_MODE_TRUNCATE);
Tests tries to find Users database tables under default database as entities are shared, and truncate fails.
Also in case of cross database join, I had to use database name in mapping yml, e.g.
in Users.orm.yml
table: users.profile , it is with db name, so it will truncate Production database and not users_testing.profile.
What could be the solution ?
when i wrote the Bundle I did not really thnk of multiple managers. we did pull in one PR to help a user that needed support for this in https://github.com/liip/LiipFunctionalTestBundle/pull/29 .. but I personally have no experience there.
@alexislefebvre Could you please tell more about the "move-to-fixtures-repository"?
Is this fixed in 3.0? Thanks!
@soullivaneuh this is a label to keep track of issues and PR which should be moved to https://github.com/liip/LiipTestFixturesBundle, because all the database features have been removed in the 3.x version of LiipFunctionalTestBundle.