public function HighlightTest::regressionBug3022724DataProvider in Search API 8
Provides test data for testRegressionBug3022724().
Return value
array An array of argument arrays for testRegressionBug3022724().
File
- tests/
src/ Unit/ Processor/ HighlightTest.php, line 1093
Class
- HighlightTest
- Tests the "Highlight" processor.
Namespace
Drupal\Tests\search_api\Unit\ProcessorCode
public function regressionBug3022724DataProvider() {
return [
'multiple snippets' => [
'text' => 'field value 1 … field value 2 … field value with first foo match … then long text of no matches, interspersed with some Hungarian: Jó napot kívánok! Hogy vagy? … then a field value with a second foo match – will it get highlighted?',
'keys' => [
'foo',
],
'expected' => '… field value 1 … field value 2 … field value with first <strong>foo</strong> match … then long text of no matches, interspersed with … kívánok! Hogy vagy? … then a field value with a second <strong>foo</strong> match – will it get highlighted? …',
],
'overlong word in prefix' => [
'text' => 'field value 1 … field value 2 … this is someVeryLongTextWhichHasNoSpacesInItWhichCanLeadToProblemsGettingAContextForHighlightingThis.Foo.Match',
'keys' => [
'foo',
],
'expected' => '… nItWhichCanLeadToProblemsGettingAContextForHighlightingThis.<strong>Foo</strong>.Match …',
],
];
}