$highlighter->addKeywords(array($keyword));
$highlighter->highlight();
$t->is($highlighter->export(), $expected, '->highlight() does nothing if the document is invalid XHTML');
// ********************************************
// ********************************************
$xml = '
<html>
  <head>
    <title>foobar</title>
  </head>
  <body>
    <p>foobar - baz, I am prety</p>
  </body>
</html>
';
$expected = '<?xml version="1.0"?>
<html>
  <head>
    <title>foobar</title>
  </head>
  <body>
    <p><h>foobar</h> - <s>baz</s>, I am prety</p>
  </body>
</html>
';
$keyword = new sfLuceneHighlighterKeywordNamed(new sfLuceneHighlighterMarkerSprint('<h>%s</h>'), 'foobar');
$keyword2 = new sfLuceneHighlighterKeywordNamed(new sfLuceneHighlighterMarkerSprint('<s>%s</s>'), 'baz');
$highlighter = new sfLuceneHighlighterXHTML($xml);
$highlighter->addKeywords(array($keyword, $keyword2));
$highlighter->highlight();
$t->is($highlighter->export(), $expected, '->highlight() handles multiple keywords');
 /**
  * Highlights the content for $terms
  */
 protected function doHighlight(array $terms)
 {
     $content = $this->getContext()->getResponse()->getContent();
     // configure highlighter
     $lighter = new sfLuceneHighlighterXHTML($content);
     $lighter->addKeywords($terms);
     $this->getContext()->getResponse()->setContent($lighter->highlight()->export());
 }