Esempio n. 1
0
 public function actionIndex()
 {
     $parser = new MarkdownParser();
     $history = $parser->parsePath(Yii::$app->config->historyFile);
     $renderer = new NotesRenderer();
     echo $renderer->render($history);
 }
Esempio n. 2
0
 public function testRender()
 {
     $path = __DIR__ . '/minimal.md';
     $parser = new MarkdownParser();
     $history = $parser->parsePath($path);
     $text = $this->object->render($history);
     $this->assertEquals(file_get_contents($path), $text);
 }
Esempio n. 3
0
 public function actionParse($path)
 {
     if (!file_exists($path)) {
         throw new Exception('wrong path: ' . $path);
     }
     $parser = new MarkdownParser();
     $history = $parser->parsePath($path);
     var_dump($history->getTags());
 }
Esempio n. 4
0
 public function testParsePath()
 {
     $this->object->parsePath(__DIR__ . '/minimal.md');
     $history = new History();
     $history->setHeaders(['hiqdev/chkipper commits history', '-------------------------------']);
     $history->setTags([$this->object->getLastTag() => new Tag($this->object->getLastTag(), null, [$this->note => new Note($this->note, [$this->hash => new Commit($this->hash, $this->label, [$this->comment])])]), $this->object->getInitTag() => new Tag($this->object->getInitTag(), $this->date)]);
     $history->addHash($this->hash);
     $history->setLinks(['Under development' => 'https://github.com/hiqdev/chkipper/releases', 'Development started' => 'https://github.com/hiqdev/chkipper/releases', '*****@*****.**' => 'https://github.com/hiqsol', '@hiqsol' => 'https://github.com/hiqsol', 'b22f8ac' => 'https://github.com/hiqdev/chkipper/commit/b22f8ac']);
     $this->assertEquals($history, $this->object->getHistory());
 }