I've been writing several tests for my bundle now, but I can't seem to
find the right way to handle the entity manager.

First of all: how do I get it? So far I've been using this:

$client = $this->createClient();
$em = $client->get('Doctrine')->getEntityManager();

Is this the right way? Seems a bit odd to be that I have to create a
client before I can use the EM, even though I'm testing a single
Entity

Also, I've been, within the tests themselves, creating and then
cleaning up database entries, which feels really wrong to me.
Especially when a test fails - the database is not cleaned up
afterwards, causing a next test run to fail.

My best bet is probably to use Doctrine, but with SQLite in memory,
and then create tables and loading some fixtures before every test,
but how exactly do I do this? Can anyone show me an example of how
this is done?

Lastly, if this is the way to go, how do I reset the SQLite to a
database with empty tables so I can reload my fixtures?

Regards,
Bart

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to