protected function SimplesitemapTestBase::assertUniqueTextWorkaround in Simple XML sitemap 8.2
Same name and namespace in other branches
- 8.3 tests/src/Functional/SimplesitemapTestBase.php \Drupal\Tests\simple_sitemap\Functional\SimplesitemapTestBase::assertUniqueTextWorkaround()
- 4.x tests/src/Functional/SimplesitemapTestBase.php \Drupal\Tests\simple_sitemap\Functional\SimplesitemapTestBase::assertUniqueTextWorkaround()
Helper function to replace assertUniqueText.
Also adapt the legacy trait method because it can't be applied to Non-HTML pages.
@See \Drupal\FunctionalTests\AssertLegacyTrait::assertUniqueText().
Parameters
string $text: The text to look for.
1 call to SimplesitemapTestBase::assertUniqueTextWorkaround()
- SimplesitemapTest::testRemoveDuplicatesSetting in tests/
src/ Functional/ SimplesitemapTest.php - Tests the duplicate setting.
File
- tests/
src/ Functional/ SimplesitemapTestBase.php, line 90
Class
- SimplesitemapTestBase
- Provides the base class for web tests for Simple sitemap.
Namespace
Drupal\Tests\simple_sitemap\FunctionalCode
protected function assertUniqueTextWorkaround($text) {
$page_content = $this
->getSession()
->getPage()
->getContent();
$nr_found = substr_count($page_content, $text);
$this
->assertSame(1, $nr_found);
}