Пример #1
0
 public function testTwoAvailableChangesWhenUsingDummyChangeset()
 {
     $changeset = new Changeset($this->getMockGateway(0), 'dummy-changeset', __DIR__ . '/../dummy-changeset');
     $command = new Status(array($changeset));
     $command->execute();
     $this->assertEquals(2, $command->getAvailableChangesCount());
 }
Пример #2
0
 /**
  * Display dbdeploy status information including the DB's current
  * revision and any update scripts that need to be run to bring it
  * up to date.
  *
  * @param array $changesets
  * @return boolean
  */
 public function executeStatus(array $changesets)
 {
     $command = new Status($changesets);
     $command->execute();
     $this->renderer->title('dbdeploy Status');
     if (!$command->getAvailableChangesCount()) {
         $this->renderer->success('Your database schema is up to date.');
     } elseif (1 === $command->getAvailableChangesCount()) {
         $this->renderer->warn("You need to run {$command->getAvailableChangesCount()} dbdeploy script.");
     } else {
         $this->renderer->warn("You need to run {$command->getAvailableChangesCount()} dbdeploy scripts.");
     }
     foreach ($command->getAvailableChangesBySet() as $changeset => $changes) {
         $this->renderStatusForChangeset($changeset, $changes['current'], $changes['files']);
     }
     return true;
 }