_em = $this->_getTestEntityManager(); } public function testSettingInvalidFlushModeThrowsException() { $prev = $this->_em->getFlushMode(); try { $this->_em->setFlushMode('foobar'); $this->fail("Setting invalid flushmode did not trigger exception."); } catch (\Doctrine\ORM\EntityManagerException $expected) {} $this->_em->setFlushMode($prev); } }