public function testRemovalOfIllegalCss() { $html = '<p style="background-color: url(\'http://foo.com/\'); background-color: #000;" />'; $doc = new Wibble\HTML\Document($html); $doc->filter('escape'); $xpath = new \DOMXPath($doc->getDOM()); $result = $xpath->query('//p'); $this->assertEquals('background-color: #000;', $result->item(0)->getAttribute('style')); }
public function testBadFilterOnDocumentThrowsException() { $this->setExpectedException('Wibble\\Exception'); $document = new Wibble\HTML\Document($this->document); $document->filter('foo'); }