You are here

public function Html5Test::testUnknownElements in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/masterminds/html5/test/HTML5/Html5Test.php \Masterminds\HTML5\Tests\Html5Test::testUnknownElements()

File

vendor/masterminds/html5/test/HTML5/Html5Test.php, line 254

Class

Html5Test

Namespace

Masterminds\HTML5\Tests

Code

public function testUnknownElements() {

  // The : should not have special handling accourding to section 2.9 of the
  // spec. This is differenant than XML. Since we don't know these elements
  // they are handled as normal elements. Note, to do this is really
  // an invalid example and you should not embed prefixed xml in html5.
  $dom = $this->html5
    ->loadHTMLFragment("<f:rug>\n      <f:name>Big rectangle thing</f:name>\n      <f:width>40</f:width>\n      <f:length>80</f:length>\n    </f:rug>\n    <sarcasm>um, yeah</sarcasm>");
  $this
    ->assertEmpty($this->html5
    ->getErrors());
  $markup = $this->html5
    ->saveHTML($dom);
  $this
    ->assertRegExp('|<f:name>Big rectangle thing</f:name>|', $markup);
  $this
    ->assertRegExp('|<sarcasm>um, yeah</sarcasm>|', $markup);
}