protected function LinkcheckerHtmlLinkExtractorTest::getTestBody in Link checker 8
Get test HTML string.
Return value
string HTML.
1 call to LinkcheckerHtmlLinkExtractorTest::getTestBody()
- LinkcheckerHtmlLinkExtractorTest::testHtmlExtractor in tests/
src/ Kernel/ LinkcheckerHtmlLinkExtractorTest.php - Test HTML extractor.
File
- tests/
src/ Kernel/ LinkcheckerHtmlLinkExtractorTest.php, line 139
Class
- LinkcheckerHtmlLinkExtractorTest
- Test html link extractor.
Namespace
Drupal\Tests\linkchecker\KernelCode
protected function getTestBody() {
return <<<EOT
<!-- UNSUPPORTED for link checking: -->
<a href="mailto:test@example.com">Send email</a>
<a href="javascript:foo()">Execute JavaScript</a>
<!-- SUPPORTED for link checking: -->
<!-- URL in HTML comment: http://example.com/test-if-url-filter-is-disabled -->
<!-- Relative URLs -->
<img src="test.png" alt="Test image 1" />
<img src="../foo1/test.png" alt="Test image 2" />
<a href="../foo1/bar1">../foo1/bar1</a>
<a href="./foo2/bar2">./foo2/bar2</a>
<a href="../foo3/../foo4/foo5">../foo3/../foo4/foo5</a>
<a href="./foo4/../foo5/foo6">./foo4/../foo5/foo6</a>
<a href="./foo4/./foo5/foo6">./foo4/./foo5/foo6</a>
<a href="./test/foo bar/is_valid-hack.test">./test/foo bar/is_valid-hack.test</a>
<!-- URL with uncommon chars that could potentially fail to extract. See http://drupal.org/node/465462. -->
<a href="http://www.lagrandeepicerie.fr/#e-boutique/Les_produits_du_moment,2/coffret_vins_doux_naturels,149">URL with uncommon chars</a>
<a href="http://example.com/foo bar/is_valid-hack.test">URL with space</a>
<a href="http://example.com/ajax.html#key1=value1&key2=value2">URL with ajax query params</a>
<a href="http://example.com/test.html#test">URL with standard anchor</a>
<a href="http://example.com/test.html#test%20ABC">URL with standard anchor and space</a>
<a name="test ABC">Anchor with space</a>
<!-- object tag: Embed SWF files -->
<object width="150" height="116"
type="application/x-shockwave-flash"
data="http://wetterservice.msn.de/phclip.swf?zip=60329&ort=Frankfurt">
<param name="movie" value="http://wetterservice.msn.de/phclip.swf?zip=60329&ort=Frankfurt" />
<img src="flash.png" width="150" height="116" alt="" /> <br />
No weather report visible? At <a href="http://www.msn.de/">MSN</a>
you are able to find the weather report missing here and the
Flash plugin can be found at <a href="http://www.adobe.com/">Adobe</a>.
</object>
<!-- object tag: Embed Quicktime Movies on HTML pages -->
<object width="420" height="282"
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="http://example.net/video/foo1.mov" />
<param name="href" value="http://example.net/video/foo2.mov" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<param name="scale" value="aspect" />
<!--[if gte IE 7]> <!-->
<object type="video/quicktime" data="http://example.net/video/foo3.mov" width="420" height="282">
<param name="controller" value="true" />
<param name="autoplay" value="false" />
</object>
<!--<![endif]-->
</object>
<!-- object tag: Play MP4 videos on HTML pages -->
<object data="http://example.org/video/foo1.mp4" type="video/mp4" width="420" height="288">
<param name="src" value="http://example.org/video/foo2.mp4" />
<param name="autoplay" value="false" />
<param name="autoStart" value="0" />
<a href="http://example.org/video/foo3.mp4">/video/foo3.mp4</a>
</object>
<!-- object tag: Play MP4 videos with Quicktime -->
<object width="420" height="282" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="http://example.org/video/foo4.mp4" />
<param name="href" value="http://example.org/video/foo5.mp4" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<param name="scale" value="aspect" />
<!--[if gte IE 7]> <!-->
<object type="video/quicktime" data="http://example.org/video/foo6.mp4" width="420" height="282">
<param name="controller" value="true" />
<param name="autoplay" value="false" />
</object>
<!--<![endif]-->
</object>
<!-- object tag: Play flash videos on HTML pages -->
<object type="application/x-shockwave-flash" data="http://example.org/video/player1.swf" width="420" height="270">
<param name="movie" value="http://example.org/video/player2.swf" />
<param src="movie" value="http://example.org/video/player3.swf" />
<param name="flashvars" value="file=http://example.org/video/foo1.flv&width=420&height=270" />
</object>
<!-- Embed ActiveX control as objekt -->
<object width="267" height="175" classid="CLSID:05589FA1-C356-11CE-BF01-00AA0055595A">
<param name="filename" value="ritmo.mid">
</object>
<!-- Add inline frames -->
<iframe src="http://example.com/iframe/" name="ExampleIFrame" width="300" height="200">
<p>Your browser does not support inline frames.</p>
</iframe>
<!-- https://developer.mozilla.org/en/Using_audio_and_video_in_Firefox -->
<!-- http://www.theora.org/cortado/ -->
<video src="my_ogg_video.ogg" controls width="320" height="240">
<object type="application/x-java-applet" width="320" height="240">
<param name="archive" value="http://www.theora.org/cortado.jar">
<param name="code" value="com.fluendo.player.Cortado.class">
<param name="url" value="my_ogg_video2.ogg">
<p>You need to install Java to play this file.</p>
</object>
</video>
<video src="video.ogv" controls>
<object data="flvplayer1.swf" type="application/x-shockwave-flash">
<param name="movie" value="flvplayer2.swf" />
</object>
</video>
<video controls>
<source src="http://v2v.cc/~j/theora_testsuite/pixel_aspect_ratio.ogg" type="video/ogg">
<source src="http://v2v.cc/~j/theora_testsuite/pixel_aspect_ratio.mov">
Your browser does not support the <code>video</code> element.
</video>
<video controls>
<source src="foo.ogg" type="video/ogg; codecs="dirac, speex"">
Your browser does not support the <code>video</code> element.
</video>
<video src="http://v2v.cc/~j/theora_testsuite/320x240.ogg" controls>
Your browser does not support the <code>video</code> element.
</video>
EOT;
}