diff --git a/tests/unit/Grav/Common/MarkdownTest.php b/tests/unit/Grav/Common/MarkdownTest.php index d295a9899..62d532e8e 100644 --- a/tests/unit/Grav/Common/MarkdownTest.php +++ b/tests/unit/Grav/Common/MarkdownTest.php @@ -62,7 +62,7 @@ class MarkdownTest extends \Codeception\TestCase\Test return preg_replace('/^\s*(.*)/', '', $string); } - public function testDirectoryRelativeLinks() + public function testSlugRelativeLinks() { $this->assertSame($this->parsedown->text('[Down a Level](item2-2-1)'), '

Down a Level

'); @@ -82,6 +82,22 @@ class MarkdownTest extends \Codeception\TestCase\Test '

Up and Down with Anchor

'); } + public function testDirectoryRelativeLinks() + { + $this->assertSame($this->parsedown->text('[Down a Level](01.item2-2-1)'), + '

Down a Level

'); + $this->assertSame($this->parsedown->text('[Up and Down](../../03.item3/03.item3-3)'), + '

Up and Down

'); + $this->assertSame($this->parsedown->text('[Down a Level with Query](01.item2-2-1?foo=bar)'), + '

Down a Level with Query

'); + $this->assertSame($this->parsedown->text('[Up and Down with Query](../../03.item3/03.item3-3?foo=bar)'), + '

Up and Down with Query

'); +// $this->assertSame($this->parsedown->text('[Up and Down with Param](../../03.item3/03.item3-3/foo:bar)'), +// '

Up and Down with Param

'); + $this->assertSame($this->parsedown->text('[Up and Down with Anchor](../../03.item3/03.item3-3#foo)'), + '

Up and Down with Anchor

'); + } + public function testMarkdownSpecialProtocols() { $this->assertSame($this->parsedown->text('[mailto](mailto:user@domain.com)'),