public function SearchMatchTest::getText in Drupal 10
Same name and namespace in other branches
- 8 core/modules/search/tests/src/Kernel/SearchMatchTest.php \Drupal\Tests\search\Kernel\SearchMatchTest::getText()
- 9 core/modules/search/tests/src/Kernel/SearchMatchTest.php \Drupal\Tests\search\Kernel\SearchMatchTest::getText()
_test_: Helper method for generating snippets of content.
Generated items to test against: 1 ipsum 2 dolore sit 3 sit am ut 4 am ut enim am 5 ut enim am minim veniam 6 enim am minim veniam es cillum 7 am minim veniam es cillum dolore eu
File
- core/
modules/ search/ tests/ src/ Kernel/ SearchMatchTest.php, line 84
Class
- SearchMatchTest
- Indexes content and queries it.
Namespace
Drupal\Tests\search\KernelCode
public function getText($n) {
$words = explode(' ', "Ipsum dolore sit am. Ut enim am minim veniam. Es cillum dolore eu.");
return implode(' ', array_slice($words, $n - 1, $n));
}