protected function SearchApiSolrTest::getLongText in Search API Solr 8.3
Same name and namespace in other branches
- 8 tests/src/Kernel/SearchApiSolrTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrTest::getLongText()
- 8.2 tests/src/Kernel/SearchApiSolrTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrTest::getLongText()
- 4.x tests/src/Kernel/SearchApiSolrTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrTest::getLongText()
Produces a string of given comprising diverse chars.
Parameters
int $length: Length of the string.
Return value
string A random string of the specified length.
1 call to SearchApiSolrTest::getLongText()
- SearchApiSolrTest::checkSearchResultSorts in tests/
src/ Kernel/ SearchApiSolrTest.php - Tests search result sorts.
File
- tests/
src/ Kernel/ SearchApiSolrTest.php, line 818
Class
- SearchApiSolrTest
- Tests index and search capabilities using the Solr search backend.
Namespace
Drupal\Tests\search_api_solr\KernelCode
protected function getLongText($length) {
$sequence = 'abcdefghijklmnopqrstuwxyz1234567890,./;\'[]\\<>?:"{}|~!@#$%^&*()_+`1234567890-=ööążźćęółńABCDEFGHIJKLMNOPQRSTUWXYZ';
$result = '';
$i = 0;
$sequenceLength = strlen($sequence);
while ($i++ != $length) {
$result .= $sequence[$i % $sequenceLength];
}
return $result;
}