You are here

public function OutputRulesTest::testMath in Zircon Profile 8

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

File

vendor/masterminds/html5/test/HTML5/Serializer/OutputRulesTest.php, line 547

Class

OutputRulesTest

Namespace

Masterminds\HTML5\Tests\Serializer

Code

public function testMath() {
  $dom = $this->html5
    ->loadHTML('<!doctype html>
    <html lang="en">
      <body>
        <div id="foo" class="bar baz">foo bar baz</div>
        <math>
          <mi>x</mi>
          <csymbol definitionURL="http://www.example.com/mathops/multiops.html#plusminus">
            <mo>&PlusMinus;</mo>
          </csymbol>
          <mi>y</mi>
        </math>
      </body>
    </html>');
  $stream = fopen('php://temp', 'w');
  $r = new OutputRules($stream, $this->html5
    ->getOptions());
  $t = new Traverser($dom, $stream, $r, $this->html5
    ->getOptions());
  $list = $dom
    ->getElementsByTagName('math');
  $r
    ->element($list
    ->item(0));
  $content = stream_get_contents($stream, -1, 0);
  $this
    ->assertRegExp('|<math>|', $content);
  $this
    ->assertRegExp('|<csymbol definitionURL="http://www.example.com/mathops/multiops.html#plusminus">|', $content);
}