示例#1
0
 /**
  * @return Release[]
  */
 public function getReleases()
 {
     if (empty($this->releases)) {
         $headings = preg_grep('/^## (\\[?)([^\\s\\[\\]#]*)(\\]?)( - ([0-9]{4}-[0-9]{2}-[0-9]{2}))?$/', $this->content);
         while ($current_heading = current($headings)) {
             $start = key($headings);
             next($headings);
             $end = key($headings) - 1;
             $release_content = array_slice($this->content, $start, $end);
             $release = new Release($release_content);
             $this->releases[$release->getVersion()] = new Release($release_content);
         }
     }
     return $this->releases;
 }
示例#2
0
 /**
  * @dataProvider providerFiles
  */
 public function testXml($filename)
 {
     $data = $this->loadContent($filename . '.md');
     $release = new Release($data);
     $this->assertXmlStringEqualsXmlFile(__DIR__ . '/data/' . $filename . '.xml', $release->toXml());
 }