Hi all,
I am currently writing functional tests for one of my controllers which
queries the database. My strategy is to use sqlite:memory and export my
schema to the database using Doctrine 2's exporter, and then fill the
pseudo-database with random data.
First, I create the client and use its container to retrieve the Entity
Manager. I then export the schema and subsequently run my query.
Unfortunately, my fixture disappears because the
Symfony\Bundle\FrameworkBundle\Client class' doRequest() method reboots
the kernel, effectively nulling the container and creating a new one,
which in turn destroys my entity manager and creates another one, which,
you've guessed, resets the sqlite:memory database. Unless someone has a
better idea on how to inject the fixture data in my controller (remember
I'm doing blackbox testing), I would suggest moving the reboot() call
after the request is sent, which would make it possible to inject test
fixtures into the controllers.
Thank you for your time, I'll be waiting for your comments !
Cheers,
Nicolas.
--
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 developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en