assertInstanceOf('\TOC\TocMarkupFixer', $obj);
}
// ---------------------------------------------------------------
public function testFixAddsIdsOnlyToElementsWithoutThem()
{
$obj = new TocMarkupFixer();
$html = "
No ID
Existing ID
Ignored
";
$this->assertEquals(
'No ID
Existing ID
Ignored
',
$obj->fix($html, 1, 2)
);
}
// ---------------------------------------------------------------
public function testFixDoesNotDuplicateIdsWhenFixing()
{
$obj = new TocMarkupFixer();
$html = "FooBar
FooBar
FooBar
";
$this->assertEquals(
'FooBar
FooBar
FooBar
',
$obj->fix($html, 1, 3)
);
}
// ---------------------------------------------------------------
public function testFixUsesTitleAttributeWhenAvailable()
{
$obj = new TocMarkupFixer();
$html = "No ID
Existing ID
Ignored
";
$this->assertEquals(
'No ID
Existing ID
Ignored
',
$obj->fix($html, 1, 2)
);
}
}