コード例 #1
0
 public function highlightNode($prepend = '<span style="background-color:#ff0">', $append = '</span>')
 {
     return TemplateHelper::highlightNode($this->node, $prepend, $append);
 }
コード例 #2
0
 /**
  * @testdox highlightNode() tests
  * @dataProvider getHighlights
  */
 public function testHighlightNode($query, $template, $expected)
 {
     $dom = TemplateHelper::loadTemplate($template);
     $xpath = new DOMXPath($dom);
     $this->assertSame($expected, TemplateHelper::highlightNode($xpath->query($query)->item(0), '<span style="background-color:#ff0">', '</span>'));
 }