예제 #1
0
 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'));
 }
예제 #2
0
 public function testBadFilterOnDocumentThrowsException()
 {
     $this->setExpectedException('Wibble\\Exception');
     $document = new Wibble\HTML\Document($this->document);
     $document->filter('foo');
 }