public function CoreSearchTest::testSearchSimplify in Snowball Stemmer 8
Same name and namespace in other branches
- 2.x tests/src/Kernel/CoreSearchTest.php \Drupal\Tests\snowball_stemmer\Kernel\CoreSearchTest::testSearchSimplify()
Tests search_simplify() and the stemmer hook_search_preprocess integration.
File
- tests/
src/ Kernel/ CoreSearchTest.php, line 40
Class
- CoreSearchTest
- Tests the search_excerpt() function.
Namespace
Drupal\Tests\snowball_stemmer\KernelCode
public function testSearchSimplify() {
$this->stemmerService
->expects($this
->once())
->method('setLanguage')
->with('en')
->willReturn(TRUE);
$this->stemmerService
->expects($this
->exactly(4))
->method('stem')
->withConsecutive([
'the',
], [
'quick',
], [
'brown',
], [
'fox',
]);
$text = 'The quick brown fox';
$language = 'en';
search_simplify($text, $language);
}