You are here

function SearchMatchTest::getText2 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::getText2()

_test2_: Helper method for generating snippets of content.

Generated items to test against: 8 dear 9 king philip 10 philip came over 11 came over from germany 12 over from germany swimming

1 call to SearchMatchTest::getText2()
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 100
Contains \Drupal\search\Tests\SearchMatchTest.

Class

SearchMatchTest
Indexes content and queries it.

Namespace

Drupal\search\Tests

Code

function getText2($n) {
  $words = explode(' ', "Dear King Philip came over from Germany swimming.");
  return implode(' ', array_slice($words, $n - 1, $n));
}