[MODM-99] ODM tests drop all collections from all databases on the MongoDB server Created: 08/Dec/10  Updated: 20/Dec/10  Resolved: 20/Dec/10

Status: Resolved
Project: Doctrine MongoDB ODM
Component/s: None
Affects Version/s: 1.0.0BETA1
Fix Version/s: 1.0.0BETA2

Type: Improvement Priority: Major
Reporter: Vitaliy Kaplich Assignee: Jonathan H. Wage
Resolution: Fixed Votes: 0
Labels: None
Environment:

Cent OS 5.5, PHP 5.3.3



 Description   

Recently I run ODM tests in my sandbox and found out that all collections in all databases were dropped after that.
Thanks god I did run it in my sandbox only which has own database instance.

After reviewing the code I found out that Doctrine\ODM\MongoDB\Tests\BaseTest->tearDown() method cleans up the whole MongoDB server after running the tests.

From one hand such extremely unsafe behavior is not mentioned anywhere from another hand there are no ways to work around it currently but only changing the tests code.

It would be really great if there is a way to specify MongoDB connection parameters for ODM tests or at least change tests code in order to drop only databases which were created during the test
and no others else.

Thank you.


Generated at Thu Apr 17 03:58:36 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.