On Tue, Jun 14, 2011 at 12:52 PM, waldo2188 <waldo2...@gmail.com> wrote:
> Hi, > > I wish to know how i can execute some DQL(Doctrine Query Language) > from a unit test file. > > I just want to have access to my Entity for test some function. > > The unit test will be run with PHPUnit. > > use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class TestCase extends WebTestCase { public function testSomeStuff() { $em = $this->getService('doctrine')->getEntityManager(); } } Disclaimer: There may be a better class to inherit from, or a better way to do this. -- 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