| @@ 238-244 (lines=7) @@ | ||
| 235 | * @param string $keywords Keywords to highlight | |
| 236 | * @param string $expectedValue Expected output (XML encoded safely) | |
| 237 | */ | |
| 238 | public function testContextSummary($originalValue, $limit, $keywords, $expectedValue) | |
| 239 |     { | |
| 240 |         $text = DBField::create_field('Text', $originalValue); | |
| 241 |         $result = $text->obj('ContextSummary', [$limit, $keywords])->forTemplate(); | |
| 242 | // it should highlight 3 letters or more. | |
| 243 | $this->assertEquals($expectedValue, $result); | |
| 244 | } | |
| 245 | ||
| 246 | public function testRAW() | |
| 247 |     { | |
| @@ 336-342 (lines=7) @@ | ||
| 333 | * @param string $keywords Keywords to highlight | |
| 334 | * @param string $expectedValue Expected output (XML encoded safely) | |
| 335 | */ | |
| 336 | public function testContextSummary($originalValue, $limit, $keywords, $expectedValue) | |
| 337 |     { | |
| 338 |         $text = DBField::create_field('HTMLFragment', $originalValue); | |
| 339 |         $result = $text->obj('ContextSummary', [$limit, $keywords])->forTemplate(); | |
| 340 | // it should highlight 3 letters or more. | |
| 341 | $this->assertEquals($expectedValue, $result); | |
| 342 | } | |
| 343 | ||
| 344 | public function testRAW() | |
| 345 |     { | |