public function setUp()
 {
     $this->git = $this->getMock("\\Liip\\RMT\\VCS\\GitFlow");
     $this->context = new \Liip\RMT\Context();
     $this->context->setService('vcs', $this->git);
     $this->context->setService('output', $this->getMock("\\Liip\\RMT\\Output\\Output"));
     $this->action = new \Liip\RMT\Action\GitFlowStartReleaseAction();
     $this->action->setContext($this->context);
 }
Ejemplo n.º 2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $detector = new GitFlowBranch($this->getContext()->getVCS(), GitFlowBranch::RELEASE);
     if ($detector->isInTheFlow()) {
         throw new Exception("Detected a git flow branch. Finish it first.");
     }
     // Generate and save the new version number
     $increment = $this->getContext()->getInformationCollector()->getValueFor('type');
     $generator = new \Liip\RMT\Version\Generator\SemanticGenerator();
     $newVersion = $generator->generateNextVersion($this->getContext()->getParam('current-version'), $increment);
     $this->getContext()->setNewVersion($newVersion);
     $action = new GitFlowStartReleaseAction();
     $action->setContext($this->getContext());
     $action->execute();
 }