
| Current Path : /var/www/html/rocksensor1/web/core/tests/Drupal/Tests/Core/Test/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/rocksensor1/web/core/tests/Drupal/Tests/Core/Test/AssertContentTraitTest.php |
<?php
declare(strict_types=1);
namespace Drupal\Tests\Core\Test;
use Drupal\KernelTests\AssertContentTrait;
use Drupal\Tests\UnitTestCase;
/**
* @coversDefaultClass \Drupal\KernelTests\AssertContentTrait
* @group Test
*/
class AssertContentTraitTest extends UnitTestCase {
use AssertContentTrait;
/**
* @covers ::getTextContent
*/
public function testGetTextContent(): void {
$raw_content = <<<EOT
<Head>
<style>
@import url("foo.css");
</style>
</head>
<body>
bar
</body>
EOT;
$this->setRawContent($raw_content);
$this->assertStringNotContainsString('foo', $this->getTextContent());
$this->assertStringNotContainsString('<body>', $this->getTextContent());
$this->assertStringContainsString('bar', $this->getTextContent());
}
}