2015-08-08 02:03:20 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Cms\Classes\Theme;
|
|
|
|
|
use Cms\Classes\Content;
|
|
|
|
|
|
2020-02-07 08:59:39 +00:00
|
|
|
class ContentTest extends TestCase
|
2015-08-08 02:03:20 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public function testMarkdownContent()
|
|
|
|
|
{
|
|
|
|
|
$theme = Theme::load('test');
|
|
|
|
|
$content = Content::load($theme, 'markdown-content.md');
|
|
|
|
|
|
|
|
|
|
$this->assertEquals('Be brave, be **bold**, live *italic*', $content->markup);
|
|
|
|
|
$this->assertEquals('<p>Be brave, be <strong>bold</strong>, live <em>italic</em></p>', $content->parsedMarkup);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testTextContent()
|
|
|
|
|
{
|
|
|
|
|
$theme = Theme::load('test');
|
|
|
|
|
$content = Content::load($theme, 'text-content.txt');
|
|
|
|
|
|
|
|
|
|
$this->assertEquals('Pen is <mightier> than the sword, HTML is <richer> than the text', $content->markup);
|
|
|
|
|
$this->assertEquals('Pen is <mightier> than the sword, HTML is <richer> than the text', $content->parsedMarkup);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testHtmlContent()
|
|
|
|
|
{
|
|
|
|
|
$theme = Theme::load('test');
|
|
|
|
|
$content = Content::load($theme, 'html-content.htm');
|
|
|
|
|
|
|
|
|
|
$this->assertEquals('<a href="#">Stephen Saucier</a> changed his profile picture — <small>7 hrs ago</small></div>', $content->markup);
|
|
|
|
|
$this->assertEquals('<a href="#">Stephen Saucier</a> changed his profile picture — <small>7 hrs ago</small></div>', $content->parsedMarkup);
|
|
|
|
|
}
|
2017-04-24 11:38:19 +00:00
|
|
|
}
|