Esempio n. 1
0
 public function testBefore(TestEvent $e)
 {
     if (isset($this->config['connectionIds'])) {
         foreach ((array) $this->config['connectionIds'] as $connectionId) {
             try {
                 (new Mangan($connectionId))->dropDb();
             } catch (ManganException $e) {
                 // Skip if not existing db is about to be dropped
                 if ($e->getCode() !== ExceptionCodeInterface::CouldNotSelect) {
                     throw $e;
                 }
             }
         }
     } else {
         try {
             (new Mangan())->dropDb();
         } catch (ManganException $e) {
             // Skip if not existing db is about to be dropped
             if ($e->getCode() !== ExceptionCodeInterface::CouldNotSelect) {
                 throw $e;
             }
         }
     }
 }