public function test() { $node = $this->nf->div($this->nf->a('hello world')); $this->assertEquals('<div><a>hello world</a></div>', $node->__toString()); $node = $this->nf->div([$this->nf->a(), $this->nf->abbr()], $this->nf->span()); $this->assertEquals('<div><a></a><abbr></abbr><span></span></div>', $node->__toString()); $node = $this->nf->div(['class' => 'hello'], [$this->nf->a(), $this->nf->abbr()], null, $this->nf->span('test')); $this->assertEquals('<div class="hello"><a></a><abbr></abbr><span>test</span></div>', $node->__toString()); }
public function test_UriInjectionWithWhitespace() { $nf = new NodeFactory('utf-8'); $this->setExpectedException('InvalidArgumentException'); $nf->a(['href' => ' javascript: alert(1) ']); }