コード例 #1
0
 public function testRenderBlockThrowsExceptionIfNoRenderer()
 {
     $block = $this->getMock(AbstractBlock::class);
     $this->setExpectedException(RuntimeException::class, sprintf('Unable to find corresponding renderer for block type: "%s"', get_class($block)));
     $renderer = new CliRenderer([], [], new Color());
     $renderer->renderBlock($block);
 }
コード例 #2
0
 /**
  * @param string $markdown
  * @return string
  */
 public function render($markdown)
 {
     $ast = $this->docParser->parse($markdown);
     return $this->cliRenderer->renderBlock($ast);
 }