public function setUp() { $this->application = new Application(); $this->context = Context::create($this->application); $this->informationCollector = $this->getMock("\\Liip\\RMT\\Information\\InformationCollector"); $this->context->setService('information-collector', $this->informationCollector); }
/** * Returns the current context. * * @return Context */ protected function getContext() { if ($this->context === null) { $this->context = Context::create($this->getApplication()); } return $this->context; }
/** * Constructor. */ public function __construct(Context $context = null) { // Creation parent::__construct('This is release-manager', RMT_VERSION); if ($context === null) { $context = Context::create($this); } // Change the current directory in favor of the project root folder, // this allow to run the task from outside the project like: // $/home/www> myproject/RMT release chdir($this->getProjectRootDir()); // Add all command, in a controlled way and render exception if any try { // Add the default command $this->add($this->createCommand('InitCommand')); try { $config = $this->getConfig(); // Add command that require the config file $this->add($this->createCommand('ListCommand')); $this->add($this->createCommand('ReleaseCommand')); $this->add($this->createCommand('CurrentCommand')); $this->add($this->createCommand('ChangesCommand')); $this->addGitFlowCommands($context); } catch (NoConfigurationException $exception) { echo $exception->getMessage(); } } catch (\Exception $e) { $output = new \Liip\RMT\Output\Output(); $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); $this->renderException($e, $output); exit(1); } }
public function testGetVersionDetector() { $application = new \Liip\RMT\Application(); $context = Context::create($application); $actual = $context->getVersionDetector(); $this->assertInstanceOf("\\Liip\\RMT\\Version\\Detector\\DetectorInterface", $actual); }