protected function setUp() { $this->createClient(); $this->importDatabaseSchema(); $this->dispatcher = $this->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface'); $this->em = self::$kernel->getContainer()->get('doctrine')->getManagerForClass('JMSJobQueueBundle:Job'); $this->repo = $this->em->getRepository('JMSJobQueueBundle:Job'); $this->repo->setDispatcher($this->dispatcher); }