You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These new tests safeguard the output generated by the `Text`, `Markdown` and `HTML` doc generators and the logic in the abstract `Generator` class.
**Notes about the setup for these tests**:
These tests use a set of test fixtures specially crafted for these tests.
The use of fixtures means that the tests don't use _real_ documentation as included with the various standards, which is subject to change and would make the tests unstable.
As the test fixtures are set up as an external standard, these tests will not only safeguard that doc generation works as expected, but also that it continues to work with external standards.
This should help prevent issues as previously fixed in a10bea6 and e5bdaad.
The footer output for the `Markdown` and `HTML` generators contains a date and a PHPCS version nr, which, again, would make the tests unstable. To mitigate this, test double classes are included for these classes, which overload the `printFooter()` methods and replaces the date and PHPCS version number with placeholders for the generic documentation tests.
The _real_ footer is still tested, but via a regex pattern in a separate test in the `MarkdownTest` and `HTMLTest` classes.
Finally, as things were, the tests for `Markdown` and `HTML` would fail on Windows due to the generated output containing mixed line endings in the HTML `<style>` tag and in the code samples for both.
Commit 85b4a90 previously changed the EOL char used for output to screen to `PHP_EOL`, but these two places were overlooked.
That is now fixed via this commit.
<divclass="tag-line">Documentation generated on #REDACTED# by <ahref="https://github.com/PHPCSStandards/PHP_CodeSniffer">PHP_CodeSniffer #VERSION#</a></div>
<li><ahref="#One-Standard-Block,-No-Code">One Standard Block, No Code</a></li>
76
+
</ul>
77
+
<aname="One-Standard-Block,-No-Code" />
78
+
<h2>One Standard Block, No Code</h2>
79
+
<pclass="text">Documentation contains one standard block and no code comparison.</p>
80
+
<divclass="tag-line">Documentation generated on #REDACTED# by <ahref="https://github.com/PHPCSStandards/PHP_CodeSniffer">PHP_CodeSniffer #VERSION#</a></div>
0 commit comments