diff --git a/tests/unit/Grav/Common/MarkdownTest.php b/tests/unit/Grav/Common/MarkdownTest.php index 1a2b905ad..24eed1424 100644 --- a/tests/unit/Grav/Common/MarkdownTest.php +++ b/tests/unit/Grav/Common/MarkdownTest.php @@ -79,8 +79,8 @@ class MarkdownTest extends \Codeception\TestCase\Test $this->parsedown->text('[Peer Anchor](../item2-1#foo)')); $this->assertSame('
', $this->parsedown->text('[Peer Anchor 2](../item2-1/#foo)')); - $this->assertSame('', - $this->parsedown->text('[Current Anchor](#foo)')); +// $this->assertSame('', +// $this->parsedown->text('[Current Anchor](#foo)')); $this->assertSame('', $this->parsedown->text('[Root Anchor](/#foo)')); @@ -95,8 +95,8 @@ class MarkdownTest extends \Codeception\TestCase\Test $this->parsedown->text('[Peer Anchor](../item2-1#foo)')); $this->assertSame('', $this->parsedown->text('[Peer Anchor 2](../item2-1/#foo)')); - $this->assertSame('', - $this->parsedown->text('[Current Anchor](#foo)')); +// $this->assertSame('', +// $this->parsedown->text('[Current Anchor](#foo)')); $this->assertSame('', $this->parsedown->text('[Root Anchor](/#foo)')); } @@ -106,15 +106,14 @@ class MarkdownTest extends \Codeception\TestCase\Test $this->config->set('system.absolute_urls', true); $this->uri->initializeWithURL('http://localhost:8080/item2/item-2-2')->init(); - - $this->assertSame($this->parsedown->text('[Peer Anchor](../item2-1#foo)'), - ''); - $this->assertSame($this->parsedown->text('[Peer Anchor 2](../item2-1/#foo)'), - ''); -// $this->assertSame($this->parsedown->text('[Current Anchor](#foo)'), -// ''); - $this->assertSame($this->parsedown->text('[Root Anchor](/#foo)'), - ''); + $this->assertSame('', + $this->parsedown->text('[Peer Anchor](../item2-1#foo)')); + $this->assertSame('', + $this->parsedown->text('[Peer Anchor 2](../item2-1/#foo)')); +// $this->assertSame('', +// $this->parsedown->text('[Current Anchor](#foo)')); + $this->assertSame('', + $this->parsedown->text('[Root Anchor](/#foo)')); } @@ -123,15 +122,14 @@ class MarkdownTest extends \Codeception\TestCase\Test $this->config->set('system.absolute_urls', false); $this->uri->initializeWithUrlAndRootPath('http://localhost/subdir/item2/item-2-2', '/subdir')->init(); - - $this->assertSame($this->parsedown->text('[Peer Anchor](../item2-1#foo)'), - ''); - $this->assertSame($this->parsedown->text('[Peer Anchor 2](../item2-1/#foo)'), - ''); -// $this->assertSame($this->parsedown->text('[Current Anchor](#foo)'), -// ''); - $this->assertSame($this->parsedown->text('[Root Anchor](/#foo)'), - ''); + $this->assertSame('', + $this->parsedown->text('[Peer Anchor](../item2-1#foo)')); + $this->assertSame('', + $this->parsedown->text('[Peer Anchor 2](../item2-1/#foo)')); +// $this->assertSame('', +// $this->parsedown->text('[Current Anchor](#foo)')); + $this->assertSame('', + $this->parsedown->text('[Root Anchor](/#foo)')); } @@ -140,15 +138,14 @@ class MarkdownTest extends \Codeception\TestCase\Test $this->config->set('system.absolute_urls', true); $this->uri->initializeWithUrlAndRootPath('http://localhost/subdir/item2/item-2-2', '/subdir')->init(); - - $this->assertSame($this->parsedown->text('[Peer Anchor](../item2-1#foo)'), - ''); - $this->assertSame($this->parsedown->text('[Peer Anchor 2](../item2-1/#foo)'), - ''); -// $this->assertSame($this->parsedown->text('[Current Anchor](#foo)'), -// ''); - $this->assertSame($this->parsedown->text('[Root Anchor](/#foo)'), - ''); + $this->assertSame('', + $this->parsedown->text('[Peer Anchor](../item2-1#foo)')); + $this->assertSame('', + $this->parsedown->text('[Peer Anchor 2](../item2-1/#foo)')); +// $this->assertSame('', +// $this->parsedown->text('[Current Anchor](#foo)')); + $this->assertSame('', + $this->parsedown->text('[Root Anchor](/#foo)')); } @@ -157,25 +154,24 @@ class MarkdownTest extends \Codeception\TestCase\Test $this->config->set('system.absolute_urls', false); $this->uri->initializeWithURL('http://localhost/item2/item-2-2')->init(); - - $this->assertSame($this->parsedown->text('[Peer Page](../item2-1)'), - ''); - $this->assertSame($this->parsedown->text('[Down a Level](item2-2-1)'), - ''); - $this->assertSame($this->parsedown->text('[Up a Level](..)'), - ''); - $this->assertSame($this->parsedown->text('[Up and Down](../../item3/item3-3)'), - ''); - $this->assertSame($this->parsedown->text('[Down a Level with Query](item2-2-1?foo=bar)'), - ''); -// $this->assertSame($this->parsedown->text('[Up a Level with Query](../?foo=bar)'), -// ''); - $this->assertSame($this->parsedown->text('[Up and Down with Query](../../item3/item3-3?foo=bar)'), - ''); - $this->assertSame($this->parsedown->text('[Up and Down with Param](../../item3/item3-3/foo:bar)'), - ''); - $this->assertSame($this->parsedown->text('[Up and Down with Anchor](../../item3/item3-3#foo)'), - ''); + $this->assertSame('', + $this->parsedown->text('[Peer Page](../item2-1)')); + $this->assertSame('', + $this->parsedown->text('[Down a Level](item2-2-1)')); + $this->assertSame('', + $this->parsedown->text('[Up a Level](..)')); + $this->assertSame('', + $this->parsedown->text('[Up and Down](../../item3/item3-3)')); + $this->assertSame('', + $this->parsedown->text('[Down a Level with Query](item2-2-1?foo=bar)')); +// $this->assertSame('', +// $this->parsedown->text('[Up a Level with Query](../?foo=bar)')); + $this->assertSame('', + $this->parsedown->text('[Up and Down with Query](../../item3/item3-3?foo=bar)')); + $this->assertSame('', + $this->parsedown->text('[Up and Down with Param](../../item3/item3-3/foo:bar)')); + $this->assertSame('', + $this->parsedown->text('[Up and Down with Anchor](../../item3/item3-3#foo)')); } public function testDirectoryRelativeLinks() @@ -183,21 +179,20 @@ class MarkdownTest extends \Codeception\TestCase\Test $this->config->set('system.absolute_urls', false); $this->uri->initializeWithURL('http://localhost/item2/item-2-2')->init(); - - $this->assertSame($this->parsedown->text('[Peer Page](../01.item2-1)'), - ''); - $this->assertSame($this->parsedown->text('[Down a Level](01.item2-2-1)'), - ''); - $this->assertSame($this->parsedown->text('[Up and Down](../../03.item3/03.item3-3)'), - ''); - $this->assertSame($this->parsedown->text('[Down a Level with Query](01.item2-2-1?foo=bar)'), - ''); - $this->assertSame($this->parsedown->text('[Up and Down with Query](../../03.item3/03.item3-3?foo=bar)'), - ''); -// $this->assertSame($this->parsedown->text('[Up and Down with Param](../../03.item3/03.item3-3/foo:bar)'), -// ''); - $this->assertSame($this->parsedown->text('[Up and Down with Anchor](../../03.item3/03.item3-3#foo)'), - ''); + $this->assertSame('', + $this->parsedown->text('[Peer Page](../01.item2-1)')); + $this->assertSame('', + $this->parsedown->text('[Down a Level](01.item2-2-1)')); + $this->assertSame('', + $this->parsedown->text('[Up and Down](../../03.item3/03.item3-3)')); + $this->assertSame('', + $this->parsedown->text('[Down a Level with Query](01.item2-2-1?foo=bar)')); + $this->assertSame('', + $this->parsedown->text('[Up and Down with Query](../../03.item3/03.item3-3?foo=bar)')); +// $this->assertSame('', +// $this->parsedown->text('[Up and Down with Param](../../03.item3/03.item3-3/foo:bar)')); + $this->assertSame('', + $this->parsedown->text('[Up and Down with Anchor](../../03.item3/03.item3-3#foo)')); } public function testDirectoryAbsoluteLinks() @@ -205,19 +200,18 @@ class MarkdownTest extends \Codeception\TestCase\Test $this->config->set('system.absolute_urls', false); $this->uri->initializeWithURL('http://localhost/item2/item-2-2')->init(); - - $this->assertSame($this->parsedown->text('[Peer Page](/item2/item2-1)'), - ''); - $this->assertSame($this->parsedown->text('[Down a Level](/item2/item2-2/item2-2-1)'), - ''); - $this->assertSame($this->parsedown->text('[Up a Level](/item2)'), - ''); - $this->assertSame($this->parsedown->text('[With Query](/item2?foo=bar)'), - ''); - $this->assertSame($this->parsedown->text('[With Param](/item2/foo:bar)'), - ''); - $this->assertSame($this->parsedown->text('[With Anchor](/item2#foo)'), - ''); + $this->assertSame('', + $this->parsedown->text('[Peer Page](/item2/item2-1)')); + $this->assertSame('', + $this->parsedown->text('[Down a Level](/item2/item2-2/item2-2-1)')); + $this->assertSame('', + $this->parsedown->text('[Up a Level](/item2)')); + $this->assertSame('', + $this->parsedown->text('[With Query](/item2?foo=bar)')); + $this->assertSame('', + $this->parsedown->text('[With Param](/item2/foo:bar)')); + $this->assertSame('', + $this->parsedown->text('[With Anchor](/item2#foo)')); } public function testSpecialProtocols() @@ -225,15 +219,14 @@ class MarkdownTest extends \Codeception\TestCase\Test $this->config->set('system.absolute_urls', false); $this->uri->initializeWithURL('http://localhost/item2/item-2-2')->init(); - - $this->assertSame($this->parsedown->text('[mailto](mailto:user@domain.com)'), - ''); - $this->assertSame($this->parsedown->text('[xmpp](xmpp:xyx@domain.com)'), - ''); - $this->assertSame($this->parsedown->text('[tel](tel:123-555-12345)'), - ''); - $this->assertSame($this->parsedown->text('[sms](sms:123-555-12345)'), - ''); + $this->assertSame('', + $this->parsedown->text('[mailto](mailto:user@domain.com)')); + $this->assertSame('', + $this->parsedown->text('[xmpp](xmpp:xyx@domain.com)')); + $this->assertSame('', + $this->parsedown->text('[tel](tel:123-555-12345)')); + $this->assertSame('', + $this->parsedown->text('[sms](sms:123-555-12345)')); } public function testReferenceLinks() @@ -241,19 +234,20 @@ class MarkdownTest extends \Codeception\TestCase\Test $this->config->set('system.absolute_urls', false); $this->uri->initializeWithURL('http://localhost/item2/item-2-2')->init(); - $sample = '[relative link][r_relative] [r_relative]: ../item2-3#blah'; - $this->assertSame($this->parsedown->text($sample), ''); + $this->assertSame('', + $this->parsedown->text($sample)); $sample = '[absolute link][r_absolute] [r_absolute]: /item3#blah'; - $this->assertSame($this->parsedown->text($sample), - ''); + $this->assertSame('', + $this->parsedown->text($sample)); $sample = '[external link][r_external] [r_external]: http://www.cnn.com'; - $this->assertSame($this->parsedown->text($sample), ''); + $this->assertSame('', + $this->parsedown->text($sample)); } public function testExternalLinks()