Skip to content

Commit

Permalink
Minor style fix and correction to reported test coverage in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyamcl committed Dec 23, 2019
1 parent 2fdcee4 commit a18a66e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -26,7 +26,7 @@ Features:
* Uses the flexible [KnpMenu Library](https://github.com/KnpLabs/KnpMenu) to generate menus
* [PSR-12](https://www.php-fig.org/psr/psr-12/) compliant
* Composer-compatible
* Unit-tested (100% coverage)
* Unit-tested (97% coverage)

In the spirit of [KISS philosophy](http://en.wikipedia.org/wiki/KISS_principle), this library makes a few assumptions:

Expand Down
28 changes: 12 additions & 16 deletions tests/TocGeneratorTest.php
Expand Up @@ -155,22 +155,18 @@ public function unusedHeadingLevelsAreTrimmedDataProvider(): iterable
{
$obj = new TocGenerator();

yield [
$obj->getMenu(
"<h3 id='a'>A-Header</h3><h4 id='y'>Y-Header</h4><h4 id='z'>Z-Header</h4><h3 id='x'>X-Header</h3>",
1,
6
), 2, 2
];

yield [$obj->getMenu("<h1 id='x'>X-Header</h1>", 1, 6), 1];

yield [
$obj->getMenu('<h5 id="x">X-Header</h5><h5 id="y">Y-Header</h5>', 1, 6), 2
];

yield [
$obj->getMenu('<h6 id="y">Y-Header</h6>', 1, 5), 0
return [
[
$obj->getMenu(
"<h3 id='a'>A-Header</h3><h4 id='y'>Y-Header</h4><h4 id='z'>Z-Header</h4><h3 id='x'>X-Header</h3>",
1,
6
), 2, 2
],
[$obj->getMenu("<h1 id='x'>X-Header</h1>", 1, 6), 1],
[$obj->getMenu('<h5 id="x">X-Header</h5><h5 id="y">Y-Header</h5>', 1, 6), 2],
[$obj->getMenu('<h6 id="y">Y-Header</h6>', 1, 5), 0],
[$obj->getMenu("<h1 /><h2 id='x'>X-Header</h2>", 1, 6), 1, 0]
];
}
}

0 comments on commit a18a66e

Please sign in to comment.