1 search.test | SearchMatchTestCase::_setup() |
Set up a small index of items to test against.
File
- core/
modules/ search/ tests/ search.test, line 35 - Tests for search.module.
Class
- SearchMatchTestCase
- Indexes content and queries it.
Code
function _setup() {
config_set('search.settings', 'search_minimum_word_size', 3);
for ($i = 1; $i <= 7; ++$i) {
search_index($i, SEARCH_TYPE, $this->getText($i));
}
for ($i = 1; $i <= 5; ++$i) {
search_index($i + 7, SEARCH_TYPE_2, $this->getText2($i));
}
// No getText builder function for Japanese text; just a simple array.
foreach (array(
13 => '以呂波耳・ほへとち。リヌルヲ。',
14 => 'ドルーパルが大好きよ!',
15 => 'コーヒーとケーキ',
) as $i => $jpn) {
search_index($i, SEARCH_TYPE_JPN, $jpn);
}
search_update_totals();
}