Ejemplo n.º 1
0
 /**
  * @test
  */
 public function testEscapesNodeOverriddenWithAddChildNode()
 {
     $string1 = '<strong>escape me</strong>';
     $string2 = '<strong>no, escape me!</strong>';
     $node = new EscapingNode(new TextNode($string1));
     $node->addChildNode(new TextNode($string2));
     $renderingContext = new RenderingContextFixture();
     $this->assertEquals($node->evaluate($renderingContext), htmlspecialchars($string2, ENT_QUOTES));
 }
Ejemplo n.º 2
0
 /**
  * @param EscapingNode $node
  * @return array
  */
 protected function convertEscapingNode(EscapingNode $node)
 {
     $configuration = $this->convert($node->getNode());
     $configuration['execution'] = sprintf('htmlspecialchars(%s, ENT_QUOTES)', $configuration['execution']);
     return $configuration;
 }