2011-12-26 06:00:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class HTMLPurifier_ChildDef_ListTest extends HTMLPurifier_ChildDefHarness
|
|
|
|
{
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function setUp()
|
|
|
|
{
|
2011-12-26 06:00:34 +00:00
|
|
|
parent::setUp();
|
|
|
|
$this->obj = new HTMLPurifier_ChildDef_List();
|
|
|
|
}
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testEmptyInput()
|
|
|
|
{
|
2011-12-26 06:00:34 +00:00
|
|
|
$this->assertResult('', false);
|
|
|
|
}
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testSingleLi()
|
|
|
|
{
|
2011-12-26 06:00:34 +00:00
|
|
|
$this->assertResult('<li />');
|
|
|
|
}
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testSomeLi()
|
|
|
|
{
|
2011-12-26 06:00:34 +00:00
|
|
|
$this->assertResult('<li>asdf</li><li />');
|
|
|
|
}
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testIllegal()
|
|
|
|
{
|
2011-12-26 06:00:34 +00:00
|
|
|
// XXX actually this never gets triggered in practice
|
|
|
|
$this->assertResult('<li /><b />', '<li /><li><b /></li>');
|
|
|
|
}
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testOlAtBeginning()
|
|
|
|
{
|
2011-12-26 06:00:34 +00:00
|
|
|
$this->assertResult('<ol />', '<li><ol /></li>');
|
|
|
|
}
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testOlAtBeginningWithOtherJunk()
|
|
|
|
{
|
2011-12-26 06:00:34 +00:00
|
|
|
$this->assertResult('<ol /><li />', '<li><ol /></li><li />');
|
|
|
|
}
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testOlInMiddle()
|
|
|
|
{
|
2011-12-26 06:00:34 +00:00
|
|
|
$this->assertResult('<li>Foo</li><ol><li>Bar</li></ol>', '<li>Foo<ol><li>Bar</li></ol></li>');
|
|
|
|
}
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testMultipleOl()
|
|
|
|
{
|
2011-12-26 06:00:34 +00:00
|
|
|
$this->assertResult('<li /><ol /><ol />', '<li><ol /><ol /></li>');
|
|
|
|
}
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testUlAtBeginning()
|
|
|
|
{
|
2011-12-26 06:00:34 +00:00
|
|
|
$this->assertResult('<ul />', '<li><ul /></li>');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// vim: et sw=4 sts=4
|