aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/michelf/php-markdown/test/unit/MarkdownExtraTest.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-12-12 14:51:10 +0000
committerMario <mario@mariovavti.com>2019-12-12 14:51:10 +0000
commit544ef3bc588d4180d7ecad15bdacd43813a7c5c5 (patch)
tree62372d0af859287235f62f20d0cf55b5b5b1ace3 /vendor/michelf/php-markdown/test/unit/MarkdownExtraTest.php
parent124cc4396247c75c14280136cfaa95415860ad4c (diff)
downloadvolse-hubzilla-544ef3bc588d4180d7ecad15bdacd43813a7c5c5.tar.gz
volse-hubzilla-544ef3bc588d4180d7ecad15bdacd43813a7c5c5.tar.bz2
volse-hubzilla-544ef3bc588d4180d7ecad15bdacd43813a7c5c5.zip
update composer libs and minor notifications display fixes
Diffstat (limited to 'vendor/michelf/php-markdown/test/unit/MarkdownExtraTest.php')
-rw-r--r--vendor/michelf/php-markdown/test/unit/MarkdownExtraTest.php51
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 &lt;strong class="custom">no markup&lt;/strong> test.</p>',
+ trim($result)
+ );
+ }
+}