Drupal 8  8.0.2
SearchExcerptTest Class Reference
Inheritance diagram for SearchExcerptTest:

Public Member Functions

 testSearchExcerpt ()
 
 testSearchExcerptSimplified ()
 

Static Public Attributes

static $modules = array('search', 'search_langcode_test')
 

Protected Member Functions

 doSearchExcerpt ($keys, $render_array, $langcode=NULL)
 

Detailed Description

Tests the search_excerpt() function.

search

Member Function Documentation

doSearchExcerpt (   $keys,
  $render_array,
  $langcode = NULL 
)
protected

Calls search_excerpt() and renders output.

Parameters
string$keysA string containing a search query.
string$render_arrayThe text to extract fragments from.
string | null$langcodeLanguage code for the language of $text, if known.
Returns
string A string containing HTML for the excerpt.

References Drupal\service().

Referenced by SearchExcerptTest\testSearchExcerpt(), and SearchExcerptTest\testSearchExcerptSimplified().

Here is the call graph for this function:

Here is the caller graph for this function:

testSearchExcerpt ( )

Tests search_excerpt() with several simulated search keywords.

Passes keywords and a sample marked up string, "The quick brown fox jumps over the lazy dog", and compares it to the correctly marked up string. The correctly marked up string contains either highlighted keywords or the original marked up string if no keywords matched the string.

References SearchExcerptTest\doSearchExcerpt().

Here is the call graph for this function:

testSearchExcerptSimplified ( )

Tests search_excerpt() with search keywords matching simplified words.

Excerpting should handle keywords that are matched only after going through search_simplify(). This test passes keywords that match simplified words and compares them with strings that contain the original unsimplified word.

References SearchExcerptTest\doSearchExcerpt().

Here is the call graph for this function:


The documentation for this class was generated from the following file: