class AssertContentTraitTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Test/AssertContentTraitTest.php \Drupal\Tests\Core\Test\AssertContentTraitTest
@coversDefaultClass \Drupal\KernelTests\AssertContentTrait
@group Test
Hierarchy
- class \Drupal\Tests\UnitTestCase uses \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\Core\Test\AssertContentTraitTest implements \Drupal\Tests\UnitTestCase
Expanded class hierarchy of AssertContentTraitTest
File
-
core/
tests/ Drupal/ Tests/ Core/ Test/ AssertContentTraitTest.php, line 12
Namespace
Drupal\Tests\Core\TestView source
class AssertContentTraitTest extends UnitTestCase {
/**
* @covers ::getTextContent
*/
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->assertStringNotContainsString('foo', $test->_getTextContent());
$this->assertStringNotContainsString('<body>', $test->_getTextContent());
$this->assertStringContainsString('bar', $test->_getTextContent());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.