Add test for shortcode parsing with querystring and anchor

This commit is contained in:
Robbie Averill 2019-01-29 13:14:57 +02:00
parent 0491ca03cf
commit d116b9a8d2

View File

@ -311,6 +311,15 @@ class ShortcodeParserTest extends SapphireTest
$this->assertEquals($this->extra['element']->tagName, 'a');
}
public function testShortcodeWithAnchorAndQuerystring()
{
$result = $this->parser->parse('<a href="[test_shortcode]?my-string=this&thing=2#my-anchor">Link</a>');
$this->assertContains('my-string=this', $result);
$this->assertContains('thing=2', $result);
$this->assertContains('my-anchor', $result);
}
public function testNoParseAttemptIfNoCode()
{
$stub = $this->getMockBuilder(ShortcodeParser::class)->setMethods(array('replaceElementTagsWithMarkers'))