You are here

public function Html5Test::testPCData in Zircon Profile 8.0

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

File

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

Class

Html5Test

Namespace

Masterminds\HTML5\Tests

Code

public function testPCData() {
  $res = $this
    ->cycle('<a>This is a test.</a>');
  $this
    ->assertRegExp('|This is a test.|', $res);
  $res = $this
    ->cycleFragment('<a>This is a test.</a>');
  $this
    ->assertRegExp('|This is a test.|', $res);
  $res = $this
    ->cycle('This
      is
      a
      test.');

  // Check that newlines are there, but don't count spaces.
  $this
    ->assertRegExp('|This\\n\\s*is\\n\\s*a\\n\\s*test.|', $res);
  $res = $this
    ->cycleFragment('This
      is
      a
      test.');

  // Check that newlines are there, but don't count spaces.
  $this
    ->assertRegExp('|This\\n\\s*is\\n\\s*a\\n\\s*test.|', $res);
  $res = $this
    ->cycle('<a>This <em>is</em> a test.</a>');
  $this
    ->assertRegExp('|This <em>is</em> a test.|', $res);
  $res = $this
    ->cycleFragment('<a>This <em>is</em> a test.</a>');
  $this
    ->assertRegExp('|This <em>is</em> a test.|', $res);
}