Update TOC tests

This commit is contained in:
Ivan Lanin 2014-04-06 01:10:04 +07:00
parent 14664d33f6
commit 76205c603c
1 changed files with 3 additions and 2 deletions

View File

@ -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']);