Exemplo n.º 1
0
 /**
  * Start migration setup
  *
  * @param \Symfony\Component\Console\Input\InputInterface $input
  * @return array
  */
 protected function setup(InputInterface $input)
 {
     return $this->setup->setForcedRollback($input->getOption('force-rollback'))->setExecuteQueries($input->getOption('execute'))->setRollbackedFirst($input->getOption('rollback-first'))->run();
 }
Exemplo n.º 2
0
 /**
  * @expectedException \Exception
  */
 public function testRunWithExecuteException()
 {
     $connectionMock = $this->getMockBuilder('\\Doctrine\\DBAL\\Connection')->disableOriginalConstructor()->setMethods(array('executeQuery', 'connect'))->getMock();
     $connectionMock->expects($this->any())->method('executeQuery')->will($this->throwException(new \Exception('Failed')));
     $loader = new Loader($connectionMock);
     $runner = new Runner($connectionMock);
     $factory = new Factory();
     $locator = new Locator();
     $decorator = new Decorator(new \Itkg\Core\Command\DatabaseUpdate\Template\Loader());
     $setup = new Setup($runner, $loader, $factory, $locator, $decorator, new ReleaseChecker());
     $setup->getLocator()->setParams(array('path' => TEST_BASE_DIR, 'release' => 'data'));
     $setup->setExecuteQueries(true);
     $setup->run();
 }