/**
  * @test
  * @covers ::databaseCompare
  */
 public function databaseCompareOneAction()
 {
     $comparator = $this->getMock('Etobi\\CoreAPI\\Service\\DatabaseCompareReal');
     $this->objectManagerMock->expects($this->once())->method('get')->with('Etobi\\CoreAPI\\Service\\DatabaseCompareReal')->will($this->returnValue($comparator));
     $this->subject->injectObjectManager($this->objectManagerMock);
     $this->subject->databaseCompare('1', FALSE);
 }
 /**
  * Database compare.
  * Leave the argument 'actions' empty or use "help" to see the available ones
  *
  * @param string $actions List of actions which will be executed
  * @param bool   $dry
  */
 public function databaseCompareCommand($actions = '', $dry = FALSE)
 {
     if ($actions === 'help' || strlen($actions) === 0) {
         $actions = $this->databaseApiService->databaseCompareAvailableActions();
         foreach ($actions as $number => $action) {
             $this->outputLine('  - ' . $action . ' => ' . $number);
         }
         $this->quit();
     }
     $result = $this->databaseApiService->databaseCompare($actions, $dry);
     if ($dry) {
         $this->outputLine('DB compare would execute the following queries:');
         foreach ($result as $key => $set) {
             $this->outputLine(sprintf('### Action: %s ###', $key));
             $this->outputLine('===================================');
             $this->logger->info(sprintf('### Action: %s ###', $key));
             $this->logger->info('===================================');
             foreach ($set as $line) {
                 $this->outputLine($line);
                 $this->logger->info($line);
             }
             $this->outputLine(LF);
         }
         $this->logger->info('DB compare executed in dry mode');
     } else {
         if (empty($result)) {
             $message = 'DB has been compared';
             $this->outputLine($message);
             $this->logger->info($message);
         } else {
             $message = sprintf('DB could not be compared, Error(s): %s', array(LF . implode(LF, $result)));
             $this->outputLine($message);
             $this->logger->error($message);
             $this->quit(1);
         }
     }
 }