Update TOC tests
This commit is contained in:
parent
14664d33f6
commit
76205c603c
|
|
@ -64,15 +64,16 @@ class TOCTest extends \PHPUnit_Framework_TestCase
|
||||||
'Heading 2' => 2,
|
'Heading 2' => 2,
|
||||||
'Heading 3' => 3,
|
'Heading 3' => 3,
|
||||||
);
|
);
|
||||||
|
$toc = new TOC();
|
||||||
|
|
||||||
foreach ($titles as $text => $depth) {
|
foreach ($titles as $text => $depth) {
|
||||||
$response = TOC::addTitle($text, $depth);
|
$response = $toc->addTitle($text, $depth);
|
||||||
}
|
}
|
||||||
$this->assertEquals($anchor, $response[0]);
|
$this->assertEquals($anchor, $response[0]);
|
||||||
$this->assertEquals($bookmark, $response[1]);
|
$this->assertEquals($bookmark, $response[1]);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$savedTitles = TOC::getTitles();
|
$savedTitles = $toc->getTitles();
|
||||||
foreach ($titles as $text => $depth) {
|
foreach ($titles as $text => $depth) {
|
||||||
$this->assertEquals($text, $savedTitles[$i]['text']);
|
$this->assertEquals($text, $savedTitles[$i]['text']);
|
||||||
$this->assertEquals($depth, $savedTitles[$i]['depth']);
|
$this->assertEquals($depth, $savedTitles[$i]['depth']);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue