public function testAddVersion()
 {
     $file = sys_get_temp_dir() . '/test.xml';
     @unlink($file);
     $changelog = new Changelog($file);
     $commits = array('myhash' => 'my message', 'abc' => 'def');
     $changelog->addVersion('0.1.0', 'First version', $commits);
     $this->assertContains('version="0.1.0"', file_get_contents($file));
     $versions = $changelog->getVersions();
     $this->assertEquals(1, $versions->length);
 }
 public function execute()
 {
     $changelog = new Changelog($this->options['file']);
     $changelog->addVersion($this->context->getNewVersion(), $this->context->getInformationCollector()->getValueFor('comment'), $this->getCommits());
     $this->confirmSuccess();
 }
 /**
  * @inheritdoc
  */
 public function save(Version $version)
 {
     $comment = $this->context->getInformationCollector()->getValueFor('comment');
     $type = $this->context->getInformationCollector()->getValueFor('type', null);
     $this->changelog->addVersion($version, $comment, array());
 }