Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function printChangeLog(ChangeLog $changeLog)
 {
     $out = ['# ' . $this->getOption('title')];
     $out[] = $this->getOption('intro');
     $out[] = '';
     $whiteList = $this->getOption('versions_whitelist');
     $blackList = $this->getOption('versions_blacklist');
     foreach ($changeLog->getEntries() as $entry) {
         if (!$this->checkWhiteAndBlackLists($entry->version, $whiteList, $blackList)) {
             continue;
         }
         $entryOut = $this->printEntry($entry);
         if (!empty($entryOut)) {
             $out[] = $entryOut;
             $out[] = '';
         }
     }
     return join(PHP_EOL, $out);
 }
Пример #2
0
 public function testEntries()
 {
     $cl = new ChangeLog();
     $this->assertEmpty($cl->getEntries());
     $e1 = new Entry();
     $cl->addEntry($e1);
     $this->assertCount(1, $cl->getEntries());
     $this->assertSame($e1, $cl->getEntries()[0]);
     $e2 = new Entry();
     $cl->addEntry($e2);
     $this->assertCount(2, $cl->getEntries());
     $this->assertSame($e1, $cl->getEntries()[0]);
     $this->assertSame($e2, $cl->getEntries()[1]);
 }