You are here

public function DOMTreeBuilderTest::testMathML in Zircon Profile 8

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

File

vendor/masterminds/html5/test/HTML5/Parser/DOMTreeBuilderTest.php, line 441
Test the Tree Builder.

Class

DOMTreeBuilderTest
These tests are functional, not necessarily unit tests.

Namespace

Masterminds\HTML5\Tests\Parser

Code

public function testMathML() {
  $html = '<!doctype html>
      <html lang="en">
        <body>
          <math xmlns="http://www.w3.org/1998/Math/MathML">
            <mi>x</mi>
            <csymbol definitionurl="http://www.example.com/mathops/multiops.html#plusminus">
              <mo>&PlusMinus;</mo>
            </csymbol>
            <mi>y</mi>
          </math>
        </body>
      </html>';
  $doc = $this
    ->parse($html);
  $math = $doc
    ->getElementsByTagName('math')
    ->item(0);
  $this
    ->assertEquals('math', $math->tagName);
  $this
    ->assertEquals('math', $math->nodeName);
  $this
    ->assertEquals('math', $math->localName);
  $this
    ->assertEquals('http://www.w3.org/1998/Math/MathML', $math->namespaceURI);
}