diff options
author | zotlabs <mike@macgirvin.com> | 2020-01-14 13:34:56 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2020-01-14 13:34:56 -0800 |
commit | 293d411efb28b8f20a0208e3c52883e9fbb8cea7 (patch) | |
tree | a8b0af66015815d56342daf8301ab5ae095eda0a /vendor/michelf/php-markdown/test/unit/MarkdownExtraTest.php | |
parent | 2a287e6def5ab54037222c963ab0875faf62fc1a (diff) | |
parent | d96f4340e80207a29a5c1c49cae8c25e3934d5ae (diff) | |
download | volse-hubzilla-293d411efb28b8f20a0208e3c52883e9fbb8cea7.tar.gz volse-hubzilla-293d411efb28b8f20a0208e3c52883e9fbb8cea7.tar.bz2 volse-hubzilla-293d411efb28b8f20a0208e3c52883e9fbb8cea7.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'vendor/michelf/php-markdown/test/unit/MarkdownExtraTest.php')
-rw-r--r-- | vendor/michelf/php-markdown/test/unit/MarkdownExtraTest.php | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/vendor/michelf/php-markdown/test/unit/MarkdownExtraTest.php b/vendor/michelf/php-markdown/test/unit/MarkdownExtraTest.php new file mode 100644 index 000000000..42d7b8a61 --- /dev/null +++ b/vendor/michelf/php-markdown/test/unit/MarkdownExtraTest.php @@ -0,0 +1,51 @@ +<?php + +class MarkdownExtraTest extends \PHPUnit\Framework\TestCase +{ + public function testSetupOfPredefinedAttributes() + { + $obj = new \Michelf\MarkdownExtra(); + + // Allows custom expansions of arreviations to their full version with the abbr tag + $obj->predef_abbr = array( + 'foo' => 'foobar-test', + ); + $result = $obj->transform('**Hello world, foo**'); + + $this->assertSame( + '<p><strong>Hello world, <abbr title="foobar-test">foo</abbr></strong></p>', + trim($result) + ); + } + + public function testSetupOfMultiplePredefinedAttributes() + { + $obj = new \Michelf\MarkdownExtra(); + + // Allows custom expansions of arreviations to their full version with the abbr tag + $obj->predef_abbr = array( + 'foo' => 'foobar-test', + 'ISP' => 'Internet Service Provider', + ); + $result = $obj->transform('**I get internet from an ISP. foo.**'); + + $this->assertSame( + '<p><strong>I get internet from an <abbr title="Internet Service Provider">ISP' . + '</abbr>. <abbr title="foobar-test">foo</abbr>.</strong></p>', + trim($result) + ); + } + + public function testTransformWithNoMarkup() + { + $obj = new \Michelf\MarkdownExtra(); + $obj->no_markup = true; + + $result = $obj->transform('This is a <strong class="custom">no markup</strong> test.'); + + $this->assertSame( + '<p>This is a <strong class="custom">no markup</strong> test.</p>', + trim($result) + ); + } +} |