Exemplo n.º 1
0
 public function testDocumentOutputDoesNotThrowExceptionIfTidyUnavailableButDisabledExplicitly()
 {
     if (class_exists('\\tidy', false)) {
         $this->markTestSkipped('Tidy installed');
     }
     $doc = new Wibble\HTML\Document($this->fragment, array('disable_tidy' => true));
     $doc->toString();
 }
Exemplo n.º 2
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'));
 }
Exemplo n.º 3
0
 public function testBadFilterOnDocumentThrowsException()
 {
     $this->setExpectedException('Wibble\\Exception');
     $document = new Wibble\HTML\Document($this->document);
     $document->filter('foo');
 }