diff --git a/tests/fixtures/themes/test/content/html-content.htm b/tests/fixtures/themes/test/content/html-content.htm new file mode 100644 index 000000000..9fca008a9 --- /dev/null +++ b/tests/fixtures/themes/test/content/html-content.htm @@ -0,0 +1 @@ +Stephen Saucier changed his profile picture — 7 hrs ago \ No newline at end of file diff --git a/tests/fixtures/themes/test/content/markdown-content.md b/tests/fixtures/themes/test/content/markdown-content.md new file mode 100644 index 000000000..58429128e --- /dev/null +++ b/tests/fixtures/themes/test/content/markdown-content.md @@ -0,0 +1 @@ +Be brave, be **bold**, live *italic* \ No newline at end of file diff --git a/tests/fixtures/themes/test/content/text-content.txt b/tests/fixtures/themes/test/content/text-content.txt new file mode 100644 index 000000000..c055462e5 --- /dev/null +++ b/tests/fixtures/themes/test/content/text-content.txt @@ -0,0 +1 @@ +Pen is than the sword, HTML is than the text \ No newline at end of file diff --git a/tests/unit/cms/classes/ContentTest.php b/tests/unit/cms/classes/ContentTest.php new file mode 100644 index 000000000..05eac5e82 --- /dev/null +++ b/tests/unit/cms/classes/ContentTest.php @@ -0,0 +1,36 @@ +assertEquals('Be brave, be **bold**, live *italic*', $content->markup); + $this->assertEquals('

Be brave, be bold, live italic

', $content->parsedMarkup); + } + + public function testTextContent() + { + $theme = Theme::load('test'); + $content = Content::load($theme, 'text-content.txt'); + + $this->assertEquals('Pen is than the sword, HTML is 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('Stephen Saucier changed his profile picture — 7 hrs ago', $content->markup); + $this->assertEquals('Stephen Saucier changed his profile picture — 7 hrs ago', $content->parsedMarkup); + } + +} \ No newline at end of file