Updated SSViewerTest to test for SSTemplateParser rewrite_hash_links fix

This commit is contained in:
Nik 2014-09-26 17:41:27 +12:00
parent 6141930f15
commit 5258b84e5c

View File

@ -1097,6 +1097,7 @@ after')
<body> <body>
<a class="inline" href="#anchor">InlineLink</a> <a class="inline" href="#anchor">InlineLink</a>
$InsertedLink $InsertedLink
<svg><use xlink:href="#sprite"></use></svg>
<body> <body>
</html>'); </html>');
$tmpl = new SSViewer($tmplFile); $tmpl = new SSViewer($tmplFile);
@ -1111,6 +1112,11 @@ after')
'<a class="inline" href="' . $base . '#anchor">InlineLink</a>', '<a class="inline" href="' . $base . '#anchor">InlineLink</a>',
$result $result
); );
$this->assertContains(
'<svg><use xlink:href="#sprite"></use></svg>',
$result,
'SSTemplateParser should only rewrite anchor hrefs'
);
unlink($tmplFile); unlink($tmplFile);
@ -1130,6 +1136,7 @@ after')
<body> <body>
<a class="inline" href="#anchor">InlineLink</a> <a class="inline" href="#anchor">InlineLink</a>
$InsertedLink $InsertedLink
<svg><use xlink:href="#sprite"></use></svg>
<body> <body>
</html>'); </html>');
$tmpl = new SSViewer($tmplFile); $tmpl = new SSViewer($tmplFile);
@ -1145,6 +1152,11 @@ after')
// '<a class="inline" href="<?php echo str_replace(', // '<a class="inline" href="<?php echo str_replace(',
// $result // $result
// ); // );
$this->assertContains(
'<svg><use xlink:href="#sprite"></use></svg>',
$result,
'SSTemplateParser should only rewrite anchor hrefs'
);
unlink($tmplFile); unlink($tmplFile);