mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/15403] Refactor get_context
PHPBB-15403
This commit is contained in:
@@ -39,7 +39,7 @@ class phpbb_functions_content_get_context_test extends TestCase
|
||||
'text' => 'This is a sample text containing several words, but none of them match the given words.',
|
||||
'words' => ['nonexistent'],
|
||||
'length' => 50,
|
||||
'expected' => 'This is a sample text containing several words, bu ...',
|
||||
'expected' => 'This is a sample text containing several words ...',
|
||||
],
|
||||
'desired length equal to text length' => [
|
||||
'text' => 'Exact length text.',
|
||||
@@ -57,13 +57,13 @@ class phpbb_functions_content_get_context_test extends TestCase
|
||||
'text' => 'This is a sample text containing & and < and > entities.',
|
||||
'words' => ['sample', 'entities'],
|
||||
'length' => 50,
|
||||
'expected' => 'This is a sample text containing & and < and ...',
|
||||
'expected' => 'This is a sample text ... and < and > entities.',
|
||||
],
|
||||
'text with multiple spaces and special characters' => [
|
||||
'text' => 'This is a sample text containing several words.',
|
||||
'words' => ['sample', 'several'],
|
||||
'length' => 50,
|
||||
'expected' => 'This is a sample text containing several words ...',
|
||||
'expected' => 'This is a sample text containing several words.',
|
||||
],
|
||||
'empty text' => [
|
||||
'text' => '',
|
||||
|
Reference in New Issue
Block a user