You are here

function SearchMatchTest::getText in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/search/src/Tests/SearchMatchTest.php \Drupal\search\Tests\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

1 call to SearchMatchTest::getText()
SearchMatchTest::_setup in core/modules/search/src/Tests/SearchMatchTest.php
Set up a small index of items to test against.

File

core/modules/search/src/Tests/SearchMatchTest.php, line 85
Contains \Drupal\search\Tests\SearchMatchTest.

Class

SearchMatchTest
Indexes content and queries it.

Namespace

Drupal\search\Tests

Code

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));
}