diff --git a/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleLineWrapping.html b/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleLineWrapping.html new file mode 100644 index 0000000000..fc35fdf0bf --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleLineWrapping.html @@ -0,0 +1,118 @@ + + + GeneratorTest Coding Standards + + + +

GeneratorTest Coding Standards

+ +

Code Title, line wrapping

+

This is a standard block.

+ + + + + + + + + +
Valid: exactly 45 character long description.Invalid: exactly 45 char long description---.
// Dummy.// Dummy.
+ + + + + + + + + +
Valid: exactly 46 character long description-.Invalid: exactly 46 character long description
// Dummy.// Dummy.
+ + + + + + + + + +
Valid: exactly 47 character long description--.Invalid: exactly 47 character long description.
// Dummy.// Dummy.
+ + + + + + + + + +
Valid: this description is longer than 46 characters and will wrap.Invalid: this description is longer than 46 characters and will wrap.
// Dummy.// Dummy.
+
Documentation generated on #REDACTED# by PHP_CodeSniffer #VERSION#
+ + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleLineWrapping.md b/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleLineWrapping.md new file mode 100644 index 0000000000..e5b7251aa2 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleLineWrapping.md @@ -0,0 +1,78 @@ +# GeneratorTest Coding Standard + +## Code Title, line wrapping +This is a standard block. + + + + + + + + + +
Valid: exactly 45 character long description.Invalid: exactly 45 char long description---.
+ + // Dummy. + + + + // Dummy. + +
+ + + + + + + + + +
Valid: exactly 46 character long description-.Invalid: exactly 46 character long description
+ + // Dummy. + + + + // Dummy. + +
+ + + + + + + + + +
Valid: exactly 47 character long description--.Invalid: exactly 47 character long description.
+ + // Dummy. + + + + // Dummy. + +
+ + + + + + + + + +
Valid: this description is longer than 46 characters and will wrap.Invalid: this description is longer than 46 characters and will wrap.
+ + // Dummy. + + + + // Dummy. + +
+ +Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) diff --git a/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleLineWrapping.txt b/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleLineWrapping.txt new file mode 100644 index 0000000000..11925c4cbb --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleLineWrapping.txt @@ -0,0 +1,33 @@ + +------------------------------------------------------------ +| GENERATORTEST CODING STANDARD: CODE TITLE, LINE WRAPPING | +------------------------------------------------------------ + +This is a standard block. + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| Valid: exactly 45 character long description. | Invalid: exactly 45 char long description---. | +---------------------------------------------------------------------------------------------------- +| // Dummy. | // Dummy. | +---------------------------------------------------------------------------------------------------- + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| Valid: exactly 46 character long description-. | Invalid: exactly 46 character long description | +---------------------------------------------------------------------------------------------------- +| // Dummy. | // Dummy. | +---------------------------------------------------------------------------------------------------- + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| Valid: exactly 47 character long | Invalid: exactly 47 character long | +| description--. | description. | +---------------------------------------------------------------------------------------------------- +| // Dummy. | // Dummy. | +---------------------------------------------------------------------------------------------------- + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| Valid: this description is longer than 46 | Invalid: this description is longer than 46 | +| characters and will wrap. | characters and will wrap. | +---------------------------------------------------------------------------------------------------- +| // Dummy. | // Dummy. | +---------------------------------------------------------------------------------------------------- + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleWhitespace.html b/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleWhitespace.html new file mode 100644 index 0000000000..a64cdb4deb --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleWhitespace.html @@ -0,0 +1,98 @@ + + + GeneratorTest Coding Standards + + + +

GeneratorTest Coding Standards

+ +

Code Title, whitespace handling

+

This is a standard block.

+ + + + + + + + + +
Valid: spaces at start of description.Invalid: spaces at end making line > 46 chars.
// Dummy.// Dummy.
+ + + + + + + + + +
Valid: spaces at start + end of description. Invalid: spaces ' ' in description.
// Note: description above without the
// trailing whitespace fits in 46 chars.
// Dummy.
+
Documentation generated on #REDACTED# by PHP_CodeSniffer #VERSION#
+ + diff --git a/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleWhitespace.md b/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleWhitespace.md new file mode 100644 index 0000000000..509abf6720 --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleWhitespace.md @@ -0,0 +1,43 @@ +# GeneratorTest Coding Standard + +## Code Title, whitespace handling +This is a standard block. + + + + + + + + + +
Valid: spaces at start of description.Invalid: spaces at end making line > 46 chars.
+ + // Dummy. + + + + // Dummy. + +
+ + + + + + + + + +
Valid: spaces at start + end of description. Invalid: spaces ' ' in description.
+ + // Note: description above without the + // trailing whitespace fits in 46 chars. + + + + // Dummy. + +
+ +Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) diff --git a/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleWhitespace.txt b/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleWhitespace.txt new file mode 100644 index 0000000000..80a6cc690b --- /dev/null +++ b/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleWhitespace.txt @@ -0,0 +1,22 @@ + +------------------------------------------------------------------ +| GENERATORTEST CODING STANDARD: CODE TITLE, WHITESPACE HANDLING | +------------------------------------------------------------------ + +This is a standard block. + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| Valid: spaces at start of description. | Invalid: spaces at end making line > 46 chars. | +| | | +---------------------------------------------------------------------------------------------------- +| // Dummy. | // Dummy. | +---------------------------------------------------------------------------------------------------- + +----------------------------------------- CODE COMPARISON ------------------------------------------ +| Valid: spaces at start + end of description. | Invalid: spaces ' ' in description. | +| | | +---------------------------------------------------------------------------------------------------- +| // Note: description above without the | // Dummy. | +| // trailing whitespace fits in 46 chars. | | +---------------------------------------------------------------------------------------------------- + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeTitleLineWrappingStandard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeTitleLineWrappingStandard.xml new file mode 100644 index 0000000000..b773f7a88c --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeTitleLineWrappingStandard.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeTitleWhitespaceStandard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeTitleWhitespaceStandard.xml new file mode 100644 index 0000000000..2829720259 --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeTitleWhitespaceStandard.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/CodeTitleLineWrappingSniff.php b/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/CodeTitleLineWrappingSniff.php new file mode 100644 index 0000000000..560b7884c2 --- /dev/null +++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/CodeTitleLineWrappingSniff.php @@ -0,0 +1,12 @@ + 'StandardWithDocs.Content.StandardLineWrapping', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardLineWrapping.html', ], + 'Code Title: line wrapping' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeTitleLineWrapping', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleLineWrapping.html', + ], + 'Code Title: whitespace handling' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeTitleWhitespace', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleWhitespace.html', + ], ]; }//end dataDocSpecifics() diff --git a/tests/Core/Generators/MarkdownTest.php b/tests/Core/Generators/MarkdownTest.php index c93beb4416..9612b36b84 100644 --- a/tests/Core/Generators/MarkdownTest.php +++ b/tests/Core/Generators/MarkdownTest.php @@ -149,6 +149,14 @@ public static function dataDocSpecifics() 'sniffs' => 'StandardWithDocs.Content.StandardLineWrapping', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardLineWrapping.md', ], + 'Code Title: line wrapping' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeTitleLineWrapping', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleLineWrapping.md', + ], + 'Code Title: whitespace handling' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeTitleWhitespace', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleWhitespace.md', + ], ]; }//end dataDocSpecifics() diff --git a/tests/Core/Generators/TextTest.php b/tests/Core/Generators/TextTest.php index d9740bda22..2e0c48035e 100644 --- a/tests/Core/Generators/TextTest.php +++ b/tests/Core/Generators/TextTest.php @@ -149,6 +149,14 @@ public static function dataDocSpecifics() 'sniffs' => 'StandardWithDocs.Content.StandardLineWrapping', 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardLineWrapping.txt', ], + 'Code Title: line wrapping' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeTitleLineWrapping', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleLineWrapping.txt', + ], + 'Code Title: whitespace handling' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeTitleWhitespace', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleWhitespace.txt', + ], ]; }//end dataDocSpecifics()