コード例 #1
0
    /**
     * @expectedException Kisphp\Exceptions\CodeTemplateNameNotProvided
     */
    public function testMissingCodeTemplateName()
    {
        $md = \Kisphp\MarkdownFactory::createMarkdown();
        $content = <<<EOF
:::
no template name
:::

hello world

EOF;
        $md->parse($content);
    }
コード例 #2
0
    /**
     * @expectedException \Kisphp\Exceptions\DataObjectBlockAlreadyExists
     */
    public function test_DoubleAddTemplateBlock()
    {
        $text = <<<MARKDOWN
:::code-1
this is my content
:::

:::code-1
this is my content
:::

MARKDOWN;
        $md = MarkdownFactory::createMarkdown();
        $md->parse($text);
    }
コード例 #3
0
 protected function getAvailableNamespaces()
 {
     $projectNamespaces = ['ApiBundle\\Markdown\\Blocks\\'];
     $coreNamespaces = parent::getAvailableNamespaces();
     return array_merge($projectNamespaces, $coreNamespaces);
 }
コード例 #4
0
 /**
  * @return array
  */
 public function getAvailableNamespaces()
 {
     $dummyNamespaces = ['Kisphp\\Testing\\Dummy\\Blocks\\'];
     $coreNamespaces = parent::getAvailableNamespaces();
     return array_merge($coreNamespaces, $dummyNamespaces);
 }
コード例 #5
0
ファイル: Post.php プロジェクト: cpgillem/cadegillem.me
 public function get_html_formatted_content()
 {
     /* Make use of the markdown parser dependency to parse markdown syntax. */
     $factory = MarkdownFactory::createMarkdown();
     return $factory->parse($this->content);
 }
コード例 #6
0
 public function test_BlockParagraph()
 {
     $factory = new MarkdownFactory();
     $this->assertInstanceOf($factory->getClassNamespace(BlockTypes::BLOCK_PARAGRAPH), $factory->create(BlockTypes::BLOCK_PARAGRAPH));
 }