boo
foo.

'; $filter = new Html($html, 'http://www.google.ca/'); $this->assertEquals('

boo
foo.

', $filter->execute()); } public function testIframe() { $data = ''; $f = new Html($data, 'http://blabla'); $this->assertEmpty($f->execute()); $data = ''; $expected = ''; $f = new Html($data, 'http://blabla'); $this->assertEquals($expected, $f->execute()); } public function testClearScriptAttributes() { $data = '

something

hi

'; $f = new Html($data, 'http://blabla'); $expected = '

something

hi

'; $this->assertEquals($expected, $f->execute()); } public function testClearStyleAttributes() { $data = '

something

hi

'; $f = new Html($data, 'http://blabla'); $expected = '

something

hi

'; $this->assertEquals($expected, $f->execute()); } public function testEmptyTags() { $data = << EOD; $f = new Html($data, 'http://blabla'); $output = $f->execute(); $this->assertEquals('', $output); } public function testBadAttributes() { $data = ''; $f = new Html($data, 'http://blabla'); $this->assertEquals('', $f->execute()); } public function testRelativeScheme() { $f = new Html('link', 'http://blabla'); $this->assertEquals('link', $f->execute()); } public function testAttributes() { $f = new Html('\'quote', 'http://blabla'); $this->assertEquals(''quote', $f->execute()); $f = new Html('', 'http://blabla'); $this->assertEquals('', $f->execute()); $f = new Html("", 'http://blabla'); $this->assertEquals('', $f->execute()); } public function testCode() { $data = '
HEAD / HTTP/1.1
Accept: text/html
Accept-Encoding: gzip, deflate, compress
Host: www.amazon.com
User-Agent: HTTPie/0.6.0



HTTP/1.1 405 MethodNotAllowed
Content-Encoding: gzip
Content-Type: text/html; charset=ISO-8859-1
Date: Mon, 15 Jul 2013 02:05:59 GMT
Server: Server
Set-Cookie: skin=noskin; path=/; domain=.amazon.com; expires=Mon, 15-Jul-2013 02:05:59 GMT
Vary: Accept-Encoding,User-Agent
allow: POST, GET
x-amz-id-1: 11WD3K15FC268R5GBJY5
x-amz-id-2: DDjqfqz2ZJufzqRAcj1mh+9XvSogrPohKHwXlo8IlkzH67G6w4wnjn9HYgbs4uI0
'; $f = new Html($data, 'http://blabla'); $this->assertEquals($data, $f->execute()); } public function testRemoveNoBreakingSpace() { $f = new Html('

  truc

', 'http://blabla'); $this->assertEquals('

truc

', $f->execute()); } public function testRemoveEmptyTags() { $f = new Html('

toto


', 'http://blabla'); $this->assertEquals('

toto


', $f->execute()); $f = new Html('

', 'http://blabla'); $this->assertEquals('', $f->execute()); $f = new Html('

 

', 'http://blabla'); $this->assertEquals('', $f->execute()); } public function testRemoveEmptyTable() { $f = new Html('
', 'http://blabla'); $this->assertEquals('', $f->execute()); $f = new Html('
', 'http://blabla'); $this->assertEquals('', $f->execute()); } }