You are here

public function Html5Test::testElements 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::testElements()

File

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

Class

Html5Test

Namespace

Masterminds\HTML5\Tests

Code

public function testElements() {

  // Should have content.
  $res = $this
    ->cycle('<div>FOO</div>');
  $this
    ->assertRegExp('|<div>FOO</div>|', $res);

  // Should be empty
  $res = $this
    ->cycle('<span></span>');
  $this
    ->assertRegExp('|<span></span>|', $res);

  // Should have content.
  $res = $this
    ->cycleFragment('<div>FOO</div>');
  $this
    ->assertRegExp('|<div>FOO</div>|', $res);

  // Should be empty
  $res = $this
    ->cycleFragment('<span></span>');
  $this
    ->assertRegExp('|<span></span>|', $res);

  // Elements with dashes and underscores
  $res = $this
    ->cycleFragment('<sp-an></sp-an>');
  $this
    ->assertRegExp('|<sp-an></sp-an>|', $res);
  $res = $this
    ->cycleFragment('<sp_an></sp_an>');
  $this
    ->assertRegExp('|<sp_an></sp_an>|', $res);

  // Should have no closing tag.
  $res = $this
    ->cycle('<hr>');
  $this
    ->assertRegExp('|<hr></body>|', $res);
}