assertEquals('', $filter->execute()); } public function testExecute() { $html = '
boo
foo.
boo
foo.
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 = <<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
toto
', 'http://blabla'); $this->assertEquals('', $f->execute()); $f = new Html('
', 'http://blabla'); $this->assertEquals('', $f->execute()); } public function testRemoveEmptyTable() { $f = new Html('