diff --git a/tests/unit/e107Test.php b/tests/unit/e107Test.php index cd360268f..695c527a1 100644 --- a/tests/unit/e107Test.php +++ b/tests/unit/e107Test.php @@ -766,7 +766,7 @@ $this->assertEquals("https://localhost/e107/news", $result); // var_dump(SITEURL); - + // $this->assertTrue($res); } diff --git a/tests/unit/e_mediaTest.php b/tests/unit/e_mediaTest.php index a48769018..6abddc6b7 100644 --- a/tests/unit/e_mediaTest.php +++ b/tests/unit/e_mediaTest.php @@ -151,12 +151,21 @@ { } - +*/ public function testGetGlyphs() { + $result = $this->md->getGlyphs('bs3'); + $this->assertEquals('adjust', $result[0]); + $this->assertEquals('zoom-out', $result[198]); + + $result = $this->md->getGlyphs('fab'); + $this->assertTrue(in_array('xbox', $result)); + + $result = $this->md->getGlyphs('fas'); + $this->assertTrue(in_array('check-circle', $result)); } - +/* public function testImportIcons() { diff --git a/tests/unit/e_parseTest.php b/tests/unit/e_parseTest.php index 75e3aa4c6..8ee0f9960 100644 --- a/tests/unit/e_parseTest.php +++ b/tests/unit/e_parseTest.php @@ -477,12 +477,18 @@ TMP; */ public function testToGlyph() { + $result = $this->tp->toGlyph('fa-envelope.glyph'); - $expected = " "; - $this->assertEquals($expected,$result); + $this->tp->setFontAwesome(5); + + $result = $this->tp->toGlyph('fa-mailchimp'); + $expected = " "; + $this->assertEquals($expected, $result); + + } /* public function testToBadge() @@ -533,7 +539,7 @@ TMP; foreach($tests as $val) { list($input, $expected) = $val; - $actual = $this->tp->isBbcode($input); + $actual = $this->tp->isBBcode($input); $this->assertEquals($expected, $actual, $input); } diff --git a/tests/unit/e_themeTest.php b/tests/unit/e_themeTest.php index 6ffa31b05..935e94f64 100644 --- a/tests/unit/e_themeTest.php +++ b/tests/unit/e_themeTest.php @@ -62,9 +62,24 @@ public function testGetThemeLayout() { - // FRONTPAGE = jumbotron_home - // /news = jumbotron_sidebar_right - // forum = jumbotron_full + + $pref = array ( + 'jumbotron_home' => + array ( + 0 => 'FRONTPAGE', + ), + 'jumbotron_full' => + array ( + 0 => 'forum', + ), + 'jumbotron_sidebar_right' => + array ( + 0 => '/news', + ), + ); + + $defaultLayout = "jumbotron_sidebar_right"; + $tests = array( 0 => array('url' => SITEURL."index.php", 'expected'=> 'jumbotron_home'), @@ -81,7 +96,7 @@ foreach($tests as $var) { - $result = $this->tm->getThemeLayout($var['url']); + $result = $this->tm->getThemeLayout($pref, $defaultLayout, $var['url']); $this->assertEquals($var['expected'],$result, "Wrong theme layout returned for ".$var['url']); // echo $var['url']."\t\t\t".$result."\n\n"; } diff --git a/tests/unit/plugins/e107TinyMceParserTest.php b/tests/unit/plugins/e107TinyMceParserTest.php index f3313fb0f..6d6e97fee 100644 --- a/tests/unit/plugins/e107TinyMceParserTest.php +++ b/tests/unit/plugins/e107TinyMceParserTest.php @@ -41,7 +41,7 @@ Plain text "paragraph" 2 Plain text paragraph 3 '; - $actual = $this->tm->toHtml($test); + $actual = $this->tm->toHTML($test); $expected = 'Plain text paragraph 1

Plain text "paragraph" 2
@@ -61,7 +61,7 @@ Plain text paragraph 3
'; paragraph 3'; - $actual = $this->tm->toHtml($test); + $actual = $this->tm->toHTML($test); $expected = "Bold text