コード例 #1
0
ファイル: DbdeployTest.php プロジェクト: deltasystems/dewdrop
 /**
  * @param array $methodsToMock
  * @return \PHPUnit_Framework_MockObject_MockObject|\Dewdrop\Cli\Command\Dbdeploy
  */
 private function getMockCommand(array $methodsToMock = array())
 {
     /* @var $command \PHPUnit_Framework_MockObject_MockObject|\Dewdrop\Cli\Command\Dbdeploy */
     $command = $this->getMock('\\Dewdrop\\Cli\\Command\\Dbdeploy', count($methodsToMock) ? $methodsToMock : array('abort'), array($this->runner, $this->renderer));
     $env = Env::getInstance();
     $dbTypeSuffix = 'pgsql';
     if ($env instanceof WpEnv) {
         $dbTypeSuffix = 'mysql';
     }
     $command->overrideChangesetPath($env->getProjectNoun(), $this->paths->getDewdropLib() . '/tests/Dewdrop/Cli/Command/dbdeploy-test/plugin/' . $dbTypeSuffix);
     $command->overrideChangesetPath('dewdrop-test', $this->paths->getDewdropLib() . '/tests/Dewdrop/Cli/Command/dbdeploy-test/dewdrop-test/' . $dbTypeSuffix);
     $command->overrideChangesetPath('dewdrop-core', $this->paths->getDewdropLib() . '/tests/Dewdrop/Cli/Command/dbdeploy-test/dewdrop-core/');
     $command->overrideChangelogTableName('dewdrop_test_dbdeploy_changelog');
     return $command;
 }