You are here

public function AssertContentTraitTest::testGetTextContent in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/simpletest/tests/src/Unit/AssertContentTraitTest.php \Drupal\Tests\simpletest\Unit\AssertContentTraitTest::testGetTextContent()

@covers ::getTextContent

File

core/modules/simpletest/tests/src/Unit/AssertContentTraitTest.php, line 22
Contains \Drupal\Tests\simpletest\Unit\AssertContentTraitTest.

Class

AssertContentTraitTest
@coversDefaultClass \Drupal\simpletest\AssertContentTrait @group simpletest

Namespace

Drupal\Tests\simpletest\Unit

Code

public function testGetTextContent() {
  $test = new TestClass();
  $raw_content = <<<EOT

<Head>
<style>
@import url("foo.css");
</style>
</head>
<body>
bar
</body>
EOT;
  $test
    ->_setRawContent($raw_content);
  $this
    ->assertNotContains('foo', $test
    ->_getTextContent());
  $this
    ->assertNotContains('<body>', $test
    ->_getTextContent());
  $this
    ->assertContains('bar', $test
    ->_getTextContent());
}