| @@ 330-336 (lines=7) @@ | ||
| 327 | * @param string $keywords Keywords to highlight |
|
| 328 | * @param string $expectedValue Expected output (XML encoded safely) |
|
| 329 | */ |
|
| 330 | public function testContextSummary($originalValue, $limit, $keywords, $expectedValue) |
|
| 331 | { |
|
| 332 | $text = DBField::create_field('HTMLFragment', $originalValue); |
|
| 333 | $result = $text->obj('ContextSummary', [$limit, $keywords])->forTemplate(); |
|
| 334 | // it should highlight 3 letters or more. |
|
| 335 | $this->assertEquals($expectedValue, $result); |
|
| 336 | } |
|
| 337 | ||
| 338 | public function testRAW() { |
|
| 339 | $data = DBField::create_field('HTMLFragment', 'This & This'); |
|
| @@ 234-240 (lines=7) @@ | ||
| 231 | * @param string $keywords Keywords to highlight |
|
| 232 | * @param string $expectedValue Expected output (XML encoded safely) |
|
| 233 | */ |
|
| 234 | public function testContextSummary($originalValue, $limit, $keywords, $expectedValue) |
|
| 235 | { |
|
| 236 | $text = DBField::create_field('Text', $originalValue); |
|
| 237 | $result = $text->obj('ContextSummary', [$limit, $keywords])->forTemplate(); |
|
| 238 | // it should highlight 3 letters or more. |
|
| 239 | $this->assertEquals($expectedValue, $result); |
|
| 240 | } |
|
| 241 | ||
| 242 | public function testRAW() { |
|
| 243 | $data = DBField::create_field('Text', 'This & This'); |
|