Debug database state by manually committing transactions
masterBecause the bundle automatically rolls back all changes after a test, you cannot inspect the database state after a failure using standard tools. To debug, you can manually commit the transaction and terminate the process to persist the changes:
public function testMyTestCaseThatINeedToDebug()
{
// ... database changes
\DAMA\DoctrineTestBundle\Doctrine\DBAL\StaticDriver::commit();
die;
// The changes are now persisted in the DB for inspection
}\DAMA\DoctrineTestBundle\Doctrine\DBAL\StaticDriver::commit();
die;