Write tests that verify truth of #1272
Content files with .txt extensions should not be interpreted as HTML
This commit is contained in:
parent
1123b83cf0
commit
904db06f5e
|
|
@ -0,0 +1 @@
|
|||
<a href="#">Stephen Saucier</a> changed his profile picture — <small>7 hrs ago</small></div>
|
||||
|
|
@ -0,0 +1 @@
|
|||
Be brave, be **bold**, live *italic*
|
||||
|
|
@ -0,0 +1 @@
|
|||
Pen is <mightier> than the sword, HTML is <richer> than the text
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use Cms\Classes\Theme;
|
||||
use Cms\Classes\Content;
|
||||
|
||||
class ContentTest extends TestCase
|
||||
{
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue