From b775ab99ebea78f4140c787f591465c13a36de3a Mon Sep 17 00:00:00 2001 From: "Marcel Kapfer (mmk2410)" Date: Fri, 30 Dec 2016 00:05:40 +0100 Subject: [PATCH] Added tests for BlogListGenerator --- tests/BlogListGeneratorTest.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/tests/BlogListGeneratorTest.php b/tests/BlogListGeneratorTest.php index 28038cc..2c2f943 100644 --- a/tests/BlogListGeneratorTest.php +++ b/tests/BlogListGeneratorTest.php @@ -1,12 +1,22 @@ assertEquals("Example", + BlogListGenerator::listBlog("./blogs/", "example.md", "Example Blog") + ); + $this->assertEquals("Docs", + BlogListGenerator::listBlog("./blogs/", "external.md", "Example Blog") + ); + } + public function testGetName() { $this->assertEquals("Example", BlogListGenerator::getName("blogs/example.md")); @@ -16,4 +26,14 @@ class BlogListGeneratorTest extends \PHPUnit_Framework_TestCase { $this->assertEquals(5, BlogListGenerator::getArticleAmount("example")); } + + public function testGetExternaleLink() + { + $this->assertEquals(null, + BlogListGenerator::getExternalLink("example.md", '.') + ); + $this->assertEquals("https://mmk2410.org/rangitaki/docs/", + BlogListGenerator::getExternalLink("external.md", '.') + ); + } }