From f0e57c454c2f44e6c0681353fea83ed6b7af8575 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 5 Nov 2024 12:51:46 +0100 Subject: [PATCH] Generators: add tests covering handling of invalid docs This adds another set of dedicated tests to safeguard how XML docs which don't follow the specification are handled. This initial set of tests for this documents the current behaviour [*]. This behaviour may not always be the desired behaviour, in which case, this will be fixed in follow-up commits. To get these tests up and running, the following fatal errors needed to be fixed: * Fatal error when a code comparison only contains a single code element: ``` Fatal error: Uncaught Error: Call to a member function getAttribute() on null in path/to/PHP_CodeSniffer/src/Generators/Markdown.php:253 Stack trace: #0 path/to/PHP_CodeSniffer/src/Generators/Markdown.php(139): PHP_CodeSniffer\Generators\Markdown->getFormattedCodeComparisonBlock(Object(DOMElement)) #1 path/to/PHP_CodeSniffer/src/Generators/Markdown.php(39): PHP_CodeSniffer\Generators\Markdown->processSniff(Object(DOMElement)) #2 path/to/PHP_CodeSniffer/src/Runner.php(99): PHP_CodeSniffer\Generators\Markdown->generate() #3 path/to/PHP_CodeSniffer/bin/phpcs(14): PHP_CodeSniffer\Runner->runPHPCS() #4 {main} thrown in path/to/PHP_CodeSniffer/src/Generators/Markdown.php on line 253 ``` * Fatal error when a code element contains no textual content: ``` Fatal error: Uncaught Error: Call to a member function getAttribute() on null in path/to/PHP_CodeSniffer/src/Generators/Markdown.php:246 Stack trace: #0 path/to/PHP_CodeSniffer/src/Generators/Markdown.php(139): PHP_CodeSniffer\Generators\Markdown->getFormattedCodeComparisonBlock(Object(DOMElement)) #1 path/to/PHP_CodeSniffer/src/Generators/Markdown.php(39): PHP_CodeSniffer\Generators\Markdown->processSniff(Object(DOMElement)) #2 path/to/PHP_CodeSniffer/src/Runner.php(99): PHP_CodeSniffer\Generators\Markdown->generate() #3 path/to/PHP_CodeSniffer/bin/phpcs(14): PHP_CodeSniffer\Runner->runPHPCS() #4 {main} thrown in path/to/PHP_CodeSniffer/src/Generators/Markdown.php on line 246 ``` Both of these fatals are fixed by adding defensive coding validating that there are (at least) two code blocks to the `getFormattedCodeComparisonBlock()` methods for all three generator classes. --- src/Generators/HTML.php | 17 ++-- src/Generators/Markdown.php | 17 ++-- src/Generators/Text.php | 18 ++-- ...validCodeComparisonMismatchedCodeElms.html | 88 +++++++++++++++++++ ...InvalidCodeComparisonMismatchedCodeElms.md | 25 ++++++ ...nvalidCodeComparisonMismatchedCodeElms.txt | 13 +++ ...utInvalidCodeComparisonMissingCodeElm.html | 78 ++++++++++++++++ ...tputInvalidCodeComparisonMissingCodeElm.md | 7 ++ ...putInvalidCodeComparisonMissingCodeElm.txt | 7 ++ ...ctedOutputInvalidCodeComparisonNoCode.html | 88 +++++++++++++++++++ ...pectedOutputInvalidCodeComparisonNoCode.md | 25 ++++++ ...ectedOutputInvalidCodeComparisonNoCode.txt | 13 +++ ...dOutputInvalidCodeComparisonNoContent.html | 78 ++++++++++++++++ ...tedOutputInvalidCodeComparisonNoContent.md | 7 ++ ...edOutputInvalidCodeComparisonNoContent.txt | 7 ++ ...tInvalidCodeComparisonOneEmptyCodeElm.html | 88 +++++++++++++++++++ ...putInvalidCodeComparisonOneEmptyCodeElm.md | 25 ++++++ ...utInvalidCodeComparisonOneEmptyCodeElm.txt | 13 +++ ...InvalidCodeComparisonTwoEmptyCodeElms.html | 88 +++++++++++++++++++ ...utInvalidCodeComparisonTwoEmptyCodeElms.md | 25 ++++++ ...tInvalidCodeComparisonTwoEmptyCodeElms.txt | 13 +++ .../ExpectedOutputInvalidCodeTitleEmpty.html | 88 +++++++++++++++++++ .../ExpectedOutputInvalidCodeTitleEmpty.md | 25 ++++++ .../ExpectedOutputInvalidCodeTitleEmpty.txt | 13 +++ ...ExpectedOutputInvalidCodeTitleMissing.html | 88 +++++++++++++++++++ .../ExpectedOutputInvalidCodeTitleMissing.md | 25 ++++++ .../ExpectedOutputInvalidCodeTitleMissing.txt | 13 +++ ...dOutputInvalidDocumentationTitleEmpty.html | 88 +++++++++++++++++++ ...tedOutputInvalidDocumentationTitleEmpty.md | 25 ++++++ ...edOutputInvalidDocumentationTitleEmpty.txt | 13 +++ ...utputInvalidDocumentationTitleMissing.html | 88 +++++++++++++++++++ ...dOutputInvalidDocumentationTitleMissing.md | 25 ++++++ ...OutputInvalidDocumentationTitleMissing.txt | 13 +++ ...xpectedOutputInvalidStandardNoContent.html | 88 +++++++++++++++++++ .../ExpectedOutputInvalidStandardNoContent.md | 25 ++++++ ...ExpectedOutputInvalidStandardNoContent.txt | 13 +++ ...deComparisonMismatchedCodeElmsStandard.xml | 18 ++++ .../CodeComparisonMissingCodeElmStandard.xml | 14 +++ .../Invalid/CodeComparisonNoCodeStandard.xml | 11 +++ .../CodeComparisonNoContentStandard.xml | 8 ++ .../CodeComparisonOneEmptyCodeElmStandard.xml | 15 ++++ ...CodeComparisonTwoEmptyCodeElmsStandard.xml | 12 +++ .../Docs/Invalid/CodeTitleEmptyStandard.xml | 19 ++++ .../Docs/Invalid/CodeTitleMissingStandard.xml | 19 ++++ .../DocumentationTitleEmptyStandard.xml | 19 ++++ .../DocumentationTitleMissingStandard.xml | 19 ++++ .../Invalid/StandardNoContentStandard.xml | 15 ++++ .../CodeComparisonMismatchedCodeElmsSniff.php | 12 +++ .../CodeComparisonMissingCodeElmSniff.php | 12 +++ .../Invalid/CodeComparisonNoCodeSniff.php | 12 +++ .../Invalid/CodeComparisonNoContentSniff.php | 12 +++ .../CodeComparisonOneEmptyCodeElmSniff.php | 12 +++ .../CodeComparisonTwoEmptyCodeElmsSniff.php | 12 +++ .../Sniffs/Invalid/CodeTitleEmptySniff.php | 12 +++ .../Sniffs/Invalid/CodeTitleMissingSniff.php | 12 +++ .../Invalid/DocumentationTitleEmptySniff.php | 12 +++ .../DocumentationTitleMissingSniff.php | 12 +++ .../Sniffs/Invalid/StandardNoContentSniff.php | 12 +++ tests/Core/Generators/HTMLTest.php | 76 ++++++++++++---- tests/Core/Generators/MarkdownTest.php | 76 ++++++++++++---- tests/Core/Generators/TextTest.php | 76 ++++++++++++---- 61 files changed, 1836 insertions(+), 63 deletions(-) create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.html create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.md create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.txt create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.html create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.md create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.txt create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.html create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.md create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.txt create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.html create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.md create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.txt create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.html create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.md create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.txt create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.html create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.md create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.txt create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleEmpty.html create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleEmpty.md create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleEmpty.txt create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleMissing.html create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleMissing.md create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleMissing.txt create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.html create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.md create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.txt create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.html create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.md create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.txt create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidStandardNoContent.html create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidStandardNoContent.md create mode 100644 tests/Core/Generators/Expectations/ExpectedOutputInvalidStandardNoContent.txt create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonMismatchedCodeElmsStandard.xml create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonMissingCodeElmStandard.xml create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonNoCodeStandard.xml create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonNoContentStandard.xml create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonOneEmptyCodeElmStandard.xml create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonTwoEmptyCodeElmsStandard.xml create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeTitleEmptyStandard.xml create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeTitleMissingStandard.xml create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/DocumentationTitleEmptyStandard.xml create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/DocumentationTitleMissingStandard.xml create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/StandardNoContentStandard.xml create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Invalid/CodeComparisonMismatchedCodeElmsSniff.php create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Invalid/CodeComparisonMissingCodeElmSniff.php create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Invalid/CodeComparisonNoCodeSniff.php create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Invalid/CodeComparisonNoContentSniff.php create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Invalid/CodeComparisonOneEmptyCodeElmSniff.php create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Invalid/CodeComparisonTwoEmptyCodeElmsSniff.php create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Invalid/CodeTitleEmptySniff.php create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Invalid/CodeTitleMissingSniff.php create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Invalid/DocumentationTitleEmptySniff.php create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Invalid/DocumentationTitleMissingSniff.php create mode 100644 tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Invalid/StandardNoContentSniff.php diff --git a/src/Generators/HTML.php b/src/Generators/HTML.php index 1a4833c56c..b7e209f46a 100644 --- a/src/Generators/HTML.php +++ b/src/Generators/HTML.php @@ -383,20 +383,27 @@ protected function printCodeComparisonBlock(DOMNode $node) */ protected function getFormattedCodeComparisonBlock(DOMNode $node) { - $codeBlocks = $node->getElementsByTagName('code'); + $codeBlocks = $node->getElementsByTagName('code'); + $firstCodeElm = $codeBlocks->item(0); + $secondCodeElm = $codeBlocks->item(1); - $firstTitle = trim($codeBlocks->item(0)->getAttribute('title')); + if (isset($firstCodeElm, $secondCodeElm) === false) { + // Missing at least one code block. + return ''; + } + + $firstTitle = trim($firstCodeElm->getAttribute('title')); $firstTitle = str_replace(' ', '  ', $firstTitle); - $first = trim($codeBlocks->item(0)->nodeValue); + $first = trim($firstCodeElm->nodeValue); $first = str_replace('', $first); $first = str_replace(' ', ' ', $first); $first = str_replace('', '', $first); $first = str_replace('', '', $first); - $secondTitle = trim($codeBlocks->item(1)->getAttribute('title')); + $secondTitle = trim($secondCodeElm->getAttribute('title')); $secondTitle = str_replace(' ', '  ', $secondTitle); - $second = trim($codeBlocks->item(1)->nodeValue); + $second = trim($secondCodeElm->nodeValue); $second = str_replace('', $second); $second = str_replace(' ', ' ', $second); diff --git a/src/Generators/Markdown.php b/src/Generators/Markdown.php index c2687e6dcd..d03d06a115 100644 --- a/src/Generators/Markdown.php +++ b/src/Generators/Markdown.php @@ -241,18 +241,25 @@ protected function printCodeComparisonBlock(DOMNode $node) */ protected function getFormattedCodeComparisonBlock(DOMNode $node) { - $codeBlocks = $node->getElementsByTagName('code'); + $codeBlocks = $node->getElementsByTagName('code'); + $firstCodeElm = $codeBlocks->item(0); + $secondCodeElm = $codeBlocks->item(1); - $firstTitle = trim($codeBlocks->item(0)->getAttribute('title')); + if (isset($firstCodeElm, $secondCodeElm) === false) { + // Missing at least one code block. + return ''; + } + + $firstTitle = trim($firstCodeElm->getAttribute('title')); $firstTitle = str_replace(' ', '  ', $firstTitle); - $first = trim($codeBlocks->item(0)->nodeValue); + $first = trim($firstCodeElm->nodeValue); $first = str_replace("\n", PHP_EOL.' ', $first); $first = str_replace('', '', $first); $first = str_replace('', '', $first); - $secondTitle = trim($codeBlocks->item(1)->getAttribute('title')); + $secondTitle = trim($secondCodeElm->getAttribute('title')); $secondTitle = str_replace(' ', '  ', $secondTitle); - $second = trim($codeBlocks->item(1)->nodeValue); + $second = trim($secondCodeElm->nodeValue); $second = str_replace("\n", PHP_EOL.' ', $second); $second = str_replace('', '', $second); $second = str_replace('', '', $second); diff --git a/src/Generators/Text.php b/src/Generators/Text.php index 28606bdeb4..486e76c7f9 100644 --- a/src/Generators/Text.php +++ b/src/Generators/Text.php @@ -198,9 +198,17 @@ protected function printCodeComparisonBlock(DOMNode $node) */ protected function getFormattedCodeComparisonBlock(DOMNode $node) { - $codeBlocks = $node->getElementsByTagName('code'); - $first = trim($codeBlocks->item(0)->nodeValue); - $firstTitle = trim($codeBlocks->item(0)->getAttribute('title')); + $codeBlocks = $node->getElementsByTagName('code'); + $firstCodeElm = $codeBlocks->item(0); + $secondCodeElm = $codeBlocks->item(1); + + if (isset($firstCodeElm, $secondCodeElm) === false) { + // Missing at least one code block. + return ''; + } + + $first = trim($firstCodeElm->nodeValue); + $firstTitle = trim($firstCodeElm->getAttribute('title')); $firstTitleLines = []; $tempTitle = ''; @@ -234,8 +242,8 @@ protected function getFormattedCodeComparisonBlock(DOMNode $node) $first = str_replace('', '', $first); $firstLines = explode("\n", $first); - $second = trim($codeBlocks->item(1)->nodeValue); - $secondTitle = trim($codeBlocks->item(1)->getAttribute('title')); + $second = trim($secondCodeElm->nodeValue); + $secondTitle = trim($secondCodeElm->getAttribute('title')); $secondTitleLines = []; $tempTitle = ''; diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.html b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.html new file mode 100644 index 0000000000..6ff1711cea --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.html @@ -0,0 +1,88 @@ + + + GeneratorTest Coding Standards + + + +

GeneratorTest Coding Standards

+ +

Code Comparison, mismatched code blocks

+

This doc has two code elements, one only has a title, one has actual code. Unbalanced

+ + + + + + + + + +
Code title
$a = 'Example code';
+
Documentation generated on #REDACTED# by PHP_CodeSniffer #VERSION#
+ + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.md b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.md new file mode 100644 index 0000000000..bbd1f312a7 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.md @@ -0,0 +1,25 @@ +# GeneratorTest Coding Standard + +## Code Comparison, mismatched code blocks + +This doc has two code elements, one only has a title, one has actual code. Unbalanced + + + + + + + + + +
Code title
+ + + + + + $a = 'Example code'; + +
+ +Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.txt b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.txt new file mode 100644 index 0000000000..85b3f31a08 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.txt @@ -0,0 +1,13 @@ + +-------------------------------------------------------------------------- +| GENERATORTEST CODING STANDARD: CODE COMPARISON, MISMATCHED CODE BLOCKS | +-------------------------------------------------------------------------- + +This doc has two code elements, one only has a title, one has actual code. Unbalanced + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| Code title | | +---------------------------------------------------------------------------------------------------- +| | $a = 'Example code'; | +---------------------------------------------------------------------------------------------------- + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.html b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.html new file mode 100644 index 0000000000..c699cb7d20 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.html @@ -0,0 +1,78 @@ + + + GeneratorTest Coding Standards + + + +

GeneratorTest Coding Standards

+ +

Code Comparison, missing code element

+

This is a standard block.

+
Documentation generated on #REDACTED# by PHP_CodeSniffer #VERSION#
+ + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.md b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.md new file mode 100644 index 0000000000..4cd4b41b47 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.md @@ -0,0 +1,7 @@ +# GeneratorTest Coding Standard + +## Code Comparison, missing code element + +This is a standard block. + +Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.txt b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.txt new file mode 100644 index 0000000000..0c3c6d13d8 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.txt @@ -0,0 +1,7 @@ + +------------------------------------------------------------------------ +| GENERATORTEST CODING STANDARD: CODE COMPARISON, MISSING CODE ELEMENT | +------------------------------------------------------------------------ + +This is a standard block. + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.html b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.html new file mode 100644 index 0000000000..c1db1a7bb7 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.html @@ -0,0 +1,88 @@ + + + GeneratorTest Coding Standards + + + +

GeneratorTest Coding Standards

+ +

Code Comparison, no code

+

This is a standard block.

+ + + + + + + + + +
Valid: no code.Invalid: no code.
+
Documentation generated on #REDACTED# by PHP_CodeSniffer #VERSION#
+ + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.md b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.md new file mode 100644 index 0000000000..b64dbf01f2 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.md @@ -0,0 +1,25 @@ +# GeneratorTest Coding Standard + +## Code Comparison, no code + +This is a standard block. + + + + + + + + + +
Valid: no code.Invalid: no code.
+ + + + + + + +
+ +Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.txt b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.txt new file mode 100644 index 0000000000..a99fdbc6c3 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.txt @@ -0,0 +1,13 @@ + +----------------------------------------------------------- +| GENERATORTEST CODING STANDARD: CODE COMPARISON, NO CODE | +----------------------------------------------------------- + +This is a standard block. + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| Valid: no code. | Invalid: no code. | +---------------------------------------------------------------------------------------------------- +| | | +---------------------------------------------------------------------------------------------------- + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.html b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.html new file mode 100644 index 0000000000..02b031224b --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.html @@ -0,0 +1,78 @@ + + + GeneratorTest Coding Standards + + + +

GeneratorTest Coding Standards

+ +

Code Comparison, no content

+

This is a standard block.

+
Documentation generated on #REDACTED# by PHP_CodeSniffer #VERSION#
+ + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.md b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.md new file mode 100644 index 0000000000..1cea477ff1 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.md @@ -0,0 +1,7 @@ +# GeneratorTest Coding Standard + +## Code Comparison, no content + +This is a standard block. + +Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.txt b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.txt new file mode 100644 index 0000000000..0227cdc829 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.txt @@ -0,0 +1,7 @@ + +-------------------------------------------------------------- +| GENERATORTEST CODING STANDARD: CODE COMPARISON, NO CONTENT | +-------------------------------------------------------------- + +This is a standard block. + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.html b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.html new file mode 100644 index 0000000000..8343920211 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.html @@ -0,0 +1,88 @@ + + + GeneratorTest Coding Standards + + + +

GeneratorTest Coding Standards

+ +

Code Comparison, one empty code element

+

This doc has two code elements, but only one of them has a title and actual code.

+ + + + + + + + + +
Code title
$a = 'Example code';
+
Documentation generated on #REDACTED# by PHP_CodeSniffer #VERSION#
+ + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.md b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.md new file mode 100644 index 0000000000..829f136350 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.md @@ -0,0 +1,25 @@ +# GeneratorTest Coding Standard + +## Code Comparison, one empty code element + +This doc has two code elements, but only one of them has a title and actual code. + + + + + + + + + +
Code title
+ + $a = 'Example code'; + + + + + +
+ +Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.txt b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.txt new file mode 100644 index 0000000000..7e9370595f --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.txt @@ -0,0 +1,13 @@ + +-------------------------------------------------------------------------- +| GENERATORTEST CODING STANDARD: CODE COMPARISON, ONE EMPTY CODE ELEMENT | +-------------------------------------------------------------------------- + +This doc has two code elements, but only one of them has a title and actual code. + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| Code title | | +---------------------------------------------------------------------------------------------------- +| $a = 'Example code'; | | +---------------------------------------------------------------------------------------------------- + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.html b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.html new file mode 100644 index 0000000000..f1c8f75bad --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.html @@ -0,0 +1,88 @@ + + + GeneratorTest Coding Standards + + + +

GeneratorTest Coding Standards

+ +

Code Comparison, two empty code elements

+

This doc has two code elements, but neither of them contain any information.

+ + + + + + + + + +
+
Documentation generated on #REDACTED# by PHP_CodeSniffer #VERSION#
+ + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.md b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.md new file mode 100644 index 0000000000..424c38af72 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.md @@ -0,0 +1,25 @@ +# GeneratorTest Coding Standard + +## Code Comparison, two empty code elements + +This doc has two code elements, but neither of them contain any information. + + + + + + + + + +
+ + + + + + + +
+ +Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.txt b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.txt new file mode 100644 index 0000000000..4508467076 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.txt @@ -0,0 +1,13 @@ + +--------------------------------------------------------------------------- +| GENERATORTEST CODING STANDARD: CODE COMPARISON, TWO EMPTY CODE ELEMENTS | +--------------------------------------------------------------------------- + +This doc has two code elements, but neither of them contain any information. + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| | | +---------------------------------------------------------------------------------------------------- +| | | +---------------------------------------------------------------------------------------------------- + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleEmpty.html b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleEmpty.html new file mode 100644 index 0000000000..ae9fb7aa68 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleEmpty.html @@ -0,0 +1,88 @@ + + + GeneratorTest Coding Standards + + + +

GeneratorTest Coding Standards

+ +

Code Title, empty

+

This is a standard block.

+ + + + + + + + + +
// Dummy.// Dummy.
+
Documentation generated on #REDACTED# by PHP_CodeSniffer #VERSION#
+ + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleEmpty.md b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleEmpty.md new file mode 100644 index 0000000000..312c65d486 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleEmpty.md @@ -0,0 +1,25 @@ +# GeneratorTest Coding Standard + +## Code Title, empty + +This is a standard block. + + + + + + + + + +
+ + // Dummy. + + + + // Dummy. + +
+ +Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleEmpty.txt b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleEmpty.txt new file mode 100644 index 0000000000..904a1485ea --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleEmpty.txt @@ -0,0 +1,13 @@ + +---------------------------------------------------- +| GENERATORTEST CODING STANDARD: CODE TITLE, EMPTY | +---------------------------------------------------- + +This is a standard block. + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| | | +---------------------------------------------------------------------------------------------------- +| // Dummy. | // Dummy. | +---------------------------------------------------------------------------------------------------- + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleMissing.html b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleMissing.html new file mode 100644 index 0000000000..9121273f3d --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleMissing.html @@ -0,0 +1,88 @@ + + + GeneratorTest Coding Standards + + + +

GeneratorTest Coding Standards

+ +

Code Title, missing

+

This is a standard block.

+ + + + + + + + + +
// Dummy.// Dummy.
+
Documentation generated on #REDACTED# by PHP_CodeSniffer #VERSION#
+ + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleMissing.md b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleMissing.md new file mode 100644 index 0000000000..ddd6f6b7a4 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleMissing.md @@ -0,0 +1,25 @@ +# GeneratorTest Coding Standard + +## Code Title, missing + +This is a standard block. + + + + + + + + + +
+ + // Dummy. + + + + // Dummy. + +
+ +Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleMissing.txt b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleMissing.txt new file mode 100644 index 0000000000..95adef296c --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidCodeTitleMissing.txt @@ -0,0 +1,13 @@ + +------------------------------------------------------ +| GENERATORTEST CODING STANDARD: CODE TITLE, MISSING | +------------------------------------------------------ + +This is a standard block. + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| | | +---------------------------------------------------------------------------------------------------- +| // Dummy. | // Dummy. | +---------------------------------------------------------------------------------------------------- + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.html b/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.html new file mode 100644 index 0000000000..c3c92a8a37 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.html @@ -0,0 +1,88 @@ + + + GeneratorTest Coding Standards + + + +

GeneratorTest Coding Standards

+ +

+

The above "documentation" element has an empty title attribute.

+ + + + + + + + + +
Valid: Lorem ipsum dolor sit amet.Invalid: Maecenas non rutrum dolor.
class Code {}class Comparison {}
+
Documentation generated on #REDACTED# by PHP_CodeSniffer #VERSION#
+ + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.md b/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.md new file mode 100644 index 0000000000..d36609c0f6 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.md @@ -0,0 +1,25 @@ +# GeneratorTest Coding Standard + +## + +The above "documentation" element has an empty title attribute. + + + + + + + + + +
Valid: Lorem ipsum dolor sit amet.Invalid: Maecenas non rutrum dolor.
+ + class Code {} + + + + class Comparison {} + +
+ +Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.txt b/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.txt new file mode 100644 index 0000000000..8fb0182be5 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.txt @@ -0,0 +1,13 @@ + +----------------------------------- +| GENERATORTEST CODING STANDARD: | +----------------------------------- + +The above "documentation" element has an empty title attribute. + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| Valid: Lorem ipsum dolor sit amet. | Invalid: Maecenas non rutrum dolor. | +---------------------------------------------------------------------------------------------------- +| class Code {} | class Comparison {} | +---------------------------------------------------------------------------------------------------- + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.html b/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.html new file mode 100644 index 0000000000..d0af2bea8b --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.html @@ -0,0 +1,88 @@ + + + GeneratorTest Coding Standards + + + +

GeneratorTest Coding Standards

+ +

+

The above "documentation" element is missing the title attribute.

+ + + + + + + + + +
Valid: Lorem ipsum dolor sit amet.Invalid: Maecenas non rutrum dolor.
class Code {}class Comparison {}
+
Documentation generated on #REDACTED# by PHP_CodeSniffer #VERSION#
+ + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.md b/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.md new file mode 100644 index 0000000000..5dc91a6479 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.md @@ -0,0 +1,25 @@ +# GeneratorTest Coding Standard + +## + +The above "documentation" element is missing the title attribute. + + + + + + + + + +
Valid: Lorem ipsum dolor sit amet.Invalid: Maecenas non rutrum dolor.
+ + class Code {} + + + + class Comparison {} + +
+ +Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.txt b/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.txt new file mode 100644 index 0000000000..85ef693575 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.txt @@ -0,0 +1,13 @@ + +----------------------------------- +| GENERATORTEST CODING STANDARD: | +----------------------------------- + +The above "documentation" element is missing the title attribute. + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| Valid: Lorem ipsum dolor sit amet. | Invalid: Maecenas non rutrum dolor. | +---------------------------------------------------------------------------------------------------- +| class Code {} | class Comparison {} | +---------------------------------------------------------------------------------------------------- + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidStandardNoContent.html b/tests/Core/Generators/Expectations/ExpectedOutputInvalidStandardNoContent.html new file mode 100644 index 0000000000..b5fbf05b9c --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidStandardNoContent.html @@ -0,0 +1,88 @@ + + + GeneratorTest Coding Standards + + + +

GeneratorTest Coding Standards

+ +

Standard Element, no content

+

+ + + + + + + + + +
Valid: Lorem ipsum dolor sit amet.Invalid: Maecenas non rutrum dolor.
class Code {}class Comparison {}
+
Documentation generated on #REDACTED# by PHP_CodeSniffer #VERSION#
+ + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidStandardNoContent.md b/tests/Core/Generators/Expectations/ExpectedOutputInvalidStandardNoContent.md new file mode 100644 index 0000000000..8a97b98604 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidStandardNoContent.md @@ -0,0 +1,25 @@ +# GeneratorTest Coding Standard + +## Standard Element, no content + + + + + + + + + + + +
Valid: Lorem ipsum dolor sit amet.Invalid: Maecenas non rutrum dolor.
+ + class Code {} + + + + class Comparison {} + +
+ +Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) diff --git a/tests/Core/Generators/Expectations/ExpectedOutputInvalidStandardNoContent.txt b/tests/Core/Generators/Expectations/ExpectedOutputInvalidStandardNoContent.txt new file mode 100644 index 0000000000..cb65d4f4c6 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputInvalidStandardNoContent.txt @@ -0,0 +1,13 @@ + +--------------------------------------------------------------- +| GENERATORTEST CODING STANDARD: STANDARD ELEMENT, NO CONTENT | +--------------------------------------------------------------- + + + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| Valid: Lorem ipsum dolor sit amet. | Invalid: Maecenas non rutrum dolor. | +---------------------------------------------------------------------------------------------------- +| class Code {} | class Comparison {} | +---------------------------------------------------------------------------------------------------- + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonMismatchedCodeElmsStandard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonMismatchedCodeElmsStandard.xml new file mode 100644 index 0000000000..d0cfff4110 --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonMismatchedCodeElmsStandard.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonMissingCodeElmStandard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonMissingCodeElmStandard.xml new file mode 100644 index 0000000000..999901ebbd --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonMissingCodeElmStandard.xml @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonNoCodeStandard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonNoCodeStandard.xml new file mode 100644 index 0000000000..54b50ff8db --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonNoCodeStandard.xml @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonNoContentStandard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonNoContentStandard.xml new file mode 100644 index 0000000000..0dfb12fa0d --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonNoContentStandard.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonOneEmptyCodeElmStandard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonOneEmptyCodeElmStandard.xml new file mode 100644 index 0000000000..b40674413f --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonOneEmptyCodeElmStandard.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonTwoEmptyCodeElmsStandard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonTwoEmptyCodeElmsStandard.xml new file mode 100644 index 0000000000..e6cb071451 --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeComparisonTwoEmptyCodeElmsStandard.xml @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeTitleEmptyStandard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeTitleEmptyStandard.xml new file mode 100644 index 0000000000..034bdf2fd8 --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeTitleEmptyStandard.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeTitleMissingStandard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeTitleMissingStandard.xml new file mode 100644 index 0000000000..89599dd2be --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/CodeTitleMissingStandard.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/DocumentationTitleEmptyStandard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/DocumentationTitleEmptyStandard.xml new file mode 100644 index 0000000000..c3ab071d13 --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/DocumentationTitleEmptyStandard.xml @@ -0,0 +1,19 @@ + + + + + + + class Code {} + ]]> + + + class Comparison {} + ]]> + + + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/DocumentationTitleMissingStandard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/DocumentationTitleMissingStandard.xml new file mode 100644 index 0000000000..974071d9fb --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/DocumentationTitleMissingStandard.xml @@ -0,0 +1,19 @@ + + + + + + + class Code {} + ]]> + + + class Comparison {} + ]]> + + + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/StandardNoContentStandard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/StandardNoContentStandard.xml new file mode 100644 index 0000000000..e6934706a2 --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Invalid/StandardNoContentStandard.xml @@ -0,0 +1,15 @@ + + + + + class Code {} + ]]> + + + class Comparison {} + ]]> + + + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Invalid/CodeComparisonMismatchedCodeElmsSniff.php b/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Invalid/CodeComparisonMismatchedCodeElmsSniff.php new file mode 100644 index 0000000000..91a50f4ce3 --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Invalid/CodeComparisonMismatchedCodeElmsSniff.php @@ -0,0 +1,12 @@ + [ + 'Documentation title: case' => [ 'sniffs' => 'StandardWithDocs.Content.DocumentationTitleCase', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputDocumentationTitleCase.html', ], - 'Documentation title: length' => [ + 'Documentation title: length' => [ 'sniffs' => 'StandardWithDocs.Content.DocumentationTitleLength', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputDocumentationTitleLength.html', ], - 'Standard Element: blank line handling' => [ + 'Standard Element: blank line handling' => [ 'sniffs' => 'StandardWithDocs.Content.StandardBlankLines', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardBlankLines.html', ], - 'Standard Element: encoding of special characters' => [ + 'Standard Element: encoding of special characters' => [ 'sniffs' => 'StandardWithDocs.Content.StandardEncoding', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardEncoding.html', ], - 'Standard Element: indent handling' => [ + 'Standard Element: indent handling' => [ 'sniffs' => 'StandardWithDocs.Content.StandardIndent', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardIndent.html', ], - 'Standard Element: line wrapping' => [ + 'Standard Element: line wrapping' => [ 'sniffs' => 'StandardWithDocs.Content.StandardLineWrapping', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardLineWrapping.html', ], - 'Code Title: line wrapping' => [ + 'Code Title: line wrapping' => [ 'sniffs' => 'StandardWithDocs.Content.CodeTitleLineWrapping', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleLineWrapping.html', ], - 'Code Title: whitespace handling' => [ + 'Code Title: whitespace handling' => [ 'sniffs' => 'StandardWithDocs.Content.CodeTitleWhitespace', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleWhitespace.html', ], - 'Code Comparison: blank line handling' => [ + 'Code Comparison: blank line handling' => [ 'sniffs' => 'StandardWithDocs.Content.CodeComparisonBlankLines', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonBlankLines.html', ], - 'Code Comparison: different block lengths' => [ + 'Code Comparison: different block lengths' => [ 'sniffs' => 'StandardWithDocs.Content.CodeComparisonBlockLength', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonBlockLength.html', ], - 'Code Comparison: encoding of special characters' => [ + 'Code Comparison: encoding of special characters' => [ 'sniffs' => 'StandardWithDocs.Content.CodeComparisonEncoding', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonEncoding.html', ], - 'Code Comparison: line length handling' => [ + 'Code Comparison: line length handling' => [ 'sniffs' => 'StandardWithDocs.Content.CodeComparisonLineLength', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonLineLength.html', ], - 'Unsupported: element at the wrong level' => [ + 'Unsupported: element at the wrong level' => [ 'sniffs' => 'StandardWithDocs.Unsupported.ElementAtWrongLevel', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputEmpty.txt', ], - 'Unsupported: one correct elm, one at wrong level' => [ + 'Unsupported: one correct elm, one at wrong level' => [ 'sniffs' => 'StandardWithDocs.Unsupported.OneElmAtWrongLevel', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedOneElmAtWrongLevel.html', ], - 'Unsupported: superfluous code element' => [ + 'Unsupported: superfluous code element' => [ 'sniffs' => 'StandardWithDocs.Unsupported.SuperfluousCodeElement', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedSuperfluousCodeElement.html', ], - 'Unsupported: unknown element' => [ + 'Unsupported: unknown element' => [ 'sniffs' => 'StandardWithDocs.Unsupported.UnknownElement', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputEmpty.txt', ], + 'Invalid: code comparison mismatched code elms' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonMismatchedCodeElms', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.html', + ], + 'Invalid: code comparison only has one code elm' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonMissingCodeElm', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.html', + ], + 'Invalid: code elements have no content' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonNoCode', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.html', + ], + 'Invalid: code comparison element has no content' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonNoContent', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.html', + ], + 'Invalid: code comparison two code elms, one empty' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonOneEmptyCodeElm', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.html', + ], + 'Invalid: code comparison two empty code elms' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonTwoEmptyCodeElms', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.html', + ], + 'Invalid: code title attributes are empty' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeTitleEmpty', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeTitleEmpty.html', + ], + 'Invalid: code title attributes missing' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeTitleMissing', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeTitleMissing.html', + ], + 'Invalid: documentation title attribute is empty' => [ + 'sniffs' => 'StandardWithDocs.Invalid.DocumentationTitleEmpty', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.html', + ], + 'Invalid: documentation title attribute missing' => [ + 'sniffs' => 'StandardWithDocs.Invalid.DocumentationTitleMissing', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.html', + ], + 'Invalid: standard element has no content' => [ + 'sniffs' => 'StandardWithDocs.Invalid.StandardNoContent', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidStandardNoContent.html', + ], ]; }//end dataDocSpecifics() diff --git a/tests/Core/Generators/MarkdownTest.php b/tests/Core/Generators/MarkdownTest.php index edc9db8c31..1bcddbebcc 100644 --- a/tests/Core/Generators/MarkdownTest.php +++ b/tests/Core/Generators/MarkdownTest.php @@ -125,70 +125,114 @@ public function testDocSpecifics($sniffs, $pathToExpected) public static function dataDocSpecifics() { return [ - 'Documentation title: case' => [ + 'Documentation title: case' => [ 'sniffs' => 'StandardWithDocs.Content.DocumentationTitleCase', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputDocumentationTitleCase.md', ], - 'Documentation title: length' => [ + 'Documentation title: length' => [ 'sniffs' => 'StandardWithDocs.Content.DocumentationTitleLength', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputDocumentationTitleLength.md', ], - 'Standard Element: blank line handling' => [ + 'Standard Element: blank line handling' => [ 'sniffs' => 'StandardWithDocs.Content.StandardBlankLines', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardBlankLines.md', ], - 'Standard Element: encoding of special characters' => [ + 'Standard Element: encoding of special characters' => [ 'sniffs' => 'StandardWithDocs.Content.StandardEncoding', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardEncoding.md', ], - 'Standard Element: indent handling' => [ + 'Standard Element: indent handling' => [ 'sniffs' => 'StandardWithDocs.Content.StandardIndent', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardIndent.md', ], - 'Standard Element: line wrapping' => [ + 'Standard Element: line wrapping' => [ 'sniffs' => 'StandardWithDocs.Content.StandardLineWrapping', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardLineWrapping.md', ], - 'Code Title: line wrapping' => [ + 'Code Title: line wrapping' => [ 'sniffs' => 'StandardWithDocs.Content.CodeTitleLineWrapping', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleLineWrapping.md', ], - 'Code Title: whitespace handling' => [ + 'Code Title: whitespace handling' => [ 'sniffs' => 'StandardWithDocs.Content.CodeTitleWhitespace', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleWhitespace.md', ], - 'Code Comparison: blank line handling' => [ + 'Code Comparison: blank line handling' => [ 'sniffs' => 'StandardWithDocs.Content.CodeComparisonBlankLines', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonBlankLines.md', ], - 'Code Comparison: different block lengths' => [ + 'Code Comparison: different block lengths' => [ 'sniffs' => 'StandardWithDocs.Content.CodeComparisonBlockLength', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonBlockLength.md', ], - 'Code Comparison: encoding of special characters' => [ + 'Code Comparison: encoding of special characters' => [ 'sniffs' => 'StandardWithDocs.Content.CodeComparisonEncoding', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonEncoding.md', ], - 'Code Comparison: line length handling' => [ + 'Code Comparison: line length handling' => [ 'sniffs' => 'StandardWithDocs.Content.CodeComparisonLineLength', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonLineLength.md', ], - 'Unsupported: element at the wrong level' => [ + 'Unsupported: element at the wrong level' => [ 'sniffs' => 'StandardWithDocs.Unsupported.ElementAtWrongLevel', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputEmpty.txt', ], - 'Unsupported: one correct elm, one at wrong level' => [ + 'Unsupported: one correct elm, one at wrong level' => [ 'sniffs' => 'StandardWithDocs.Unsupported.OneElmAtWrongLevel', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedOneElmAtWrongLevel.md', ], - 'Unsupported: superfluous code element' => [ + 'Unsupported: superfluous code element' => [ 'sniffs' => 'StandardWithDocs.Unsupported.SuperfluousCodeElement', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedSuperfluousCodeElement.md', ], - 'Unsupported: unknown element' => [ + 'Unsupported: unknown element' => [ 'sniffs' => 'StandardWithDocs.Unsupported.UnknownElement', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputEmpty.txt', ], + 'Invalid: code comparison mismatched code elms' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonMismatchedCodeElms', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.md', + ], + 'Invalid: code comparison only has one code elm' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonMissingCodeElm', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.md', + ], + 'Invalid: code elements have no content' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonNoCode', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.md', + ], + 'Invalid: code comparison element has no content' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonNoContent', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.md', + ], + 'Invalid: code comparison two code elms, one empty' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonOneEmptyCodeElm', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.md', + ], + 'Invalid: code comparison two empty code elms' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonTwoEmptyCodeElms', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.md', + ], + 'Invalid: code title attributes are empty' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeTitleEmpty', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeTitleEmpty.md', + ], + 'Invalid: code title attributes missing' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeTitleMissing', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeTitleMissing.md', + ], + 'Invalid: documentation title attribute is empty' => [ + 'sniffs' => 'StandardWithDocs.Invalid.DocumentationTitleEmpty', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.md', + ], + 'Invalid: documentation title attribute missing' => [ + 'sniffs' => 'StandardWithDocs.Invalid.DocumentationTitleMissing', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.md', + ], + 'Invalid: standard element has no content' => [ + 'sniffs' => 'StandardWithDocs.Invalid.StandardNoContent', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidStandardNoContent.md', + ], ]; }//end dataDocSpecifics() diff --git a/tests/Core/Generators/TextTest.php b/tests/Core/Generators/TextTest.php index 5b157bd774..33d6c7e1db 100644 --- a/tests/Core/Generators/TextTest.php +++ b/tests/Core/Generators/TextTest.php @@ -125,70 +125,114 @@ public function testDocSpecifics($sniffs, $pathToExpected) public static function dataDocSpecifics() { return [ - 'Documentation title: case' => [ + 'Documentation title: case' => [ 'sniffs' => 'StandardWithDocs.Content.DocumentationTitleCase', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputDocumentationTitleCase.txt', ], - 'Documentation title: length' => [ + 'Documentation title: length' => [ 'sniffs' => 'StandardWithDocs.Content.DocumentationTitleLength', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputDocumentationTitleLength.txt', ], - 'Standard Element: blank line handling' => [ + 'Standard Element: blank line handling' => [ 'sniffs' => 'StandardWithDocs.Content.StandardBlankLines', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardBlankLines.txt', ], - 'Standard Element: encoding of special characters' => [ + 'Standard Element: encoding of special characters' => [ 'sniffs' => 'StandardWithDocs.Content.StandardEncoding', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardEncoding.txt', ], - 'Standard Element: indent handling' => [ + 'Standard Element: indent handling' => [ 'sniffs' => 'StandardWithDocs.Content.StandardIndent', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardIndent.txt', ], - 'Standard Element: line wrapping' => [ + 'Standard Element: line wrapping' => [ 'sniffs' => 'StandardWithDocs.Content.StandardLineWrapping', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardLineWrapping.txt', ], - 'Code Title: line wrapping' => [ + 'Code Title: line wrapping' => [ 'sniffs' => 'StandardWithDocs.Content.CodeTitleLineWrapping', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleLineWrapping.txt', ], - 'Code Title: whitespace handling' => [ + 'Code Title: whitespace handling' => [ 'sniffs' => 'StandardWithDocs.Content.CodeTitleWhitespace', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleWhitespace.txt', ], - 'Code Comparison: blank line handling' => [ + 'Code Comparison: blank line handling' => [ 'sniffs' => 'StandardWithDocs.Content.CodeComparisonBlankLines', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonBlankLines.txt', ], - 'Code Comparison: different block lengths' => [ + 'Code Comparison: different block lengths' => [ 'sniffs' => 'StandardWithDocs.Content.CodeComparisonBlockLength', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonBlockLength.txt', ], - 'Code Comparison: encoding of special characters' => [ + 'Code Comparison: encoding of special characters' => [ 'sniffs' => 'StandardWithDocs.Content.CodeComparisonEncoding', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonEncoding.txt', ], - 'Code Comparison: line length handling' => [ + 'Code Comparison: line length handling' => [ 'sniffs' => 'StandardWithDocs.Content.CodeComparisonLineLength', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonLineLength.txt', ], - 'Unsupported: element at the wrong level' => [ + 'Unsupported: element at the wrong level' => [ 'sniffs' => 'StandardWithDocs.Unsupported.ElementAtWrongLevel', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputEmpty.txt', ], - 'Unsupported: one correct elm, one at wrong level' => [ + 'Unsupported: one correct elm, one at wrong level' => [ 'sniffs' => 'StandardWithDocs.Unsupported.OneElmAtWrongLevel', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedOneElmAtWrongLevel.txt', ], - 'Unsupported: superfluous code element' => [ + 'Unsupported: superfluous code element' => [ 'sniffs' => 'StandardWithDocs.Unsupported.SuperfluousCodeElement', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedSuperfluousCodeElement.txt', ], - 'Unsupported: unknown element' => [ + 'Unsupported: unknown element' => [ 'sniffs' => 'StandardWithDocs.Unsupported.UnknownElement', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputEmpty.txt', ], + 'Invalid: code comparison mismatched code elms' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonMismatchedCodeElms', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonMismatchedCodeElms.txt', + ], + 'Invalid: code comparison only has one code elm' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonMissingCodeElm', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonMissingCodeElm.txt', + ], + 'Invalid: code elements have no content' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonNoCode', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonNoCode.txt', + ], + 'Invalid: code comparison element has no content' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonNoContent', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonNoContent.txt', + ], + 'Invalid: code comparison two code elms, one empty' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonOneEmptyCodeElm', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonOneEmptyCodeElm.txt', + ], + 'Invalid: code comparison two empty code elms' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeComparisonTwoEmptyCodeElms', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeComparisonTwoEmptyCodeElms.txt', + ], + 'Invalid: code title attributes are empty' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeTitleEmpty', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeTitleEmpty.txt', + ], + 'Invalid: code title attributes missing' => [ + 'sniffs' => 'StandardWithDocs.Invalid.CodeTitleMissing', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidCodeTitleMissing.txt', + ], + 'Invalid: documentation title attribute is empty' => [ + 'sniffs' => 'StandardWithDocs.Invalid.DocumentationTitleEmpty', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidDocumentationTitleEmpty.txt', + ], + 'Invalid: documentation title attribute missing' => [ + 'sniffs' => 'StandardWithDocs.Invalid.DocumentationTitleMissing', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidDocumentationTitleMissing.txt', + ], + 'Invalid: standard element has no content' => [ + 'sniffs' => 'StandardWithDocs.Invalid.StandardNoContent', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputInvalidStandardNoContent.txt', + ], ]; }//end dataDocSpecifics()