public function testFullChangeLog()
    {
        $changeLog = new ChangeLog();
        // ---
        $entry = new Entry();
        $entry->version = '1.1.0';
        $entry->date = new \DateTime('2014-12-03');
        $changeLog->addEntry($entry);
        $section = new Section();
        $section->name = 'Added';
        $entry->addSection($section);
        $item = new Item();
        $item->description = 'Item 3';
        $section->addItem($item);
        $item = new Item();
        $item->description = 'Item 4';
        $section->addItem($item);
        $section = new Section();
        $section->name = 'Removed';
        $entry->addSection($section);
        $item = new Item();
        $item->description = 'Item 5';
        $section->addItem($item);
        // ---
        $entry = new Entry();
        $entry->version = '1.0';
        $entry->date = new \DateTime('2014-12-01');
        $changeLog->addEntry($entry);
        $section = new Section();
        $section->name = 'Added';
        $entry->addSection($section);
        $item = new Item();
        $item->description = 'Item 1';
        $section->addItem($item);
        $item = new Item();
        $item->description = 'Item 2';
        $section->addItem($item);
        // ---
        $expected = <<<TXT
# MY CHANGELOG
This is my CHANGELOG.

## 1.1.0 - 2014-12-03
### Added
- Item 3
- Item 4

### Removed
- Item 5

## 1.0.0 - 2014-12-01
### Added
- Item 1
- Item 2

TXT;
        $this->assertSame($expected, $this->printer->printChangeLog($changeLog));
    }
Пример #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]);
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function createChangeLog(Lane $list)
 {
     $changeLog = new ChangeLog();
     $cards = $list->getCards(['fields' => 'id,name,due', 'checklists' => 'all', 'filter' => $this->getOption('include_archived_cards', false) ? 'all' : 'open']);
     foreach ($cards as $card) {
         $changeLog->addEntry($this->createEntry($card));
     }
     return $changeLog;
 }