-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #717 from PHPCSStandards/feature/generators-add-te…
…sts-standard-elements Generators: add tests for handling <standard> element + use consistent encoding cross-PHP
- Loading branch information
Showing
25 changed files
with
541 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
tests/Core/Generators/Expectations/ExpectedOutputStandardBlankLines.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<html> | ||
<head> | ||
<title>GeneratorTest Coding Standards</title> | ||
<style> | ||
body { | ||
background-color: #FFFFFF; | ||
font-size: 14px; | ||
font-family: Arial, Helvetica, sans-serif; | ||
color: #000000; | ||
} | ||
|
||
h1 { | ||
color: #666666; | ||
font-size: 20px; | ||
font-weight: bold; | ||
margin-top: 0px; | ||
background-color: #E6E7E8; | ||
padding: 20px; | ||
border: 1px solid #BBBBBB; | ||
} | ||
|
||
h2 { | ||
color: #00A5E3; | ||
font-size: 16px; | ||
font-weight: normal; | ||
margin-top: 50px; | ||
} | ||
|
||
.code-comparison { | ||
width: 100%; | ||
} | ||
|
||
.code-comparison td { | ||
border: 1px solid #CCCCCC; | ||
} | ||
|
||
.code-comparison-title, .code-comparison-code { | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 12px; | ||
color: #000000; | ||
vertical-align: top; | ||
padding: 4px; | ||
width: 50%; | ||
background-color: #F1F1F1; | ||
line-height: 15px; | ||
} | ||
|
||
.code-comparison-code { | ||
font-family: Courier; | ||
background-color: #F9F9F9; | ||
} | ||
|
||
.code-comparison-highlight { | ||
background-color: #DDF1F7; | ||
border: 1px solid #00A5E3; | ||
line-height: 15px; | ||
} | ||
|
||
.tag-line { | ||
text-align: center; | ||
width: 100%; | ||
margin-top: 30px; | ||
font-size: 12px; | ||
} | ||
|
||
.tag-line a { | ||
color: #000000; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>GeneratorTest Coding Standards</h1> | ||
<a name="Standard-Element,-blank-line-handling" /> | ||
<h2>Standard Element, blank line handling</h2> | ||
<p class="text">There is a blank line at the start of this standard. | ||
|
||
And the above blank line is also deliberate to test part of the logic. | ||
|
||
Let's also end on a blank line to test that too.</p> | ||
<div class="tag-line">Documentation generated on #REDACTED# by <a href="https://github.com/PHPCSStandards/PHP_CodeSniffer">PHP_CodeSniffer #VERSION#</a></div> | ||
</body> | ||
</html> |
10 changes: 10 additions & 0 deletions
10
tests/Core/Generators/Expectations/ExpectedOutputStandardBlankLines.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# GeneratorTest Coding Standard | ||
|
||
## Standard Element, blank line handling | ||
There is a blank line at the start of this standard. | ||
|
||
And the above blank line is also deliberate to test part of the logic. | ||
|
||
Let's also end on a blank line to test that too. | ||
|
||
Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) |
11 changes: 11 additions & 0 deletions
11
tests/Core/Generators/Expectations/ExpectedOutputStandardBlankLines.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
------------------------------------------------------------------------ | ||
| GENERATORTEST CODING STANDARD: STANDARD ELEMENT, BLANK LINE HANDLING | | ||
------------------------------------------------------------------------ | ||
|
||
There is a blank line at the start of this standard. | ||
|
||
And the above blank line is also deliberate to test part of the logic. | ||
|
||
Let's also end on a blank line to test that too. | ||
|
79 changes: 79 additions & 0 deletions
79
tests/Core/Generators/Expectations/ExpectedOutputStandardEncoding.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<html> | ||
<head> | ||
<title>GeneratorTest Coding Standards</title> | ||
<style> | ||
body { | ||
background-color: #FFFFFF; | ||
font-size: 14px; | ||
font-family: Arial, Helvetica, sans-serif; | ||
color: #000000; | ||
} | ||
|
||
h1 { | ||
color: #666666; | ||
font-size: 20px; | ||
font-weight: bold; | ||
margin-top: 0px; | ||
background-color: #E6E7E8; | ||
padding: 20px; | ||
border: 1px solid #BBBBBB; | ||
} | ||
|
||
h2 { | ||
color: #00A5E3; | ||
font-size: 16px; | ||
font-weight: normal; | ||
margin-top: 50px; | ||
} | ||
|
||
.code-comparison { | ||
width: 100%; | ||
} | ||
|
||
.code-comparison td { | ||
border: 1px solid #CCCCCC; | ||
} | ||
|
||
.code-comparison-title, .code-comparison-code { | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 12px; | ||
color: #000000; | ||
vertical-align: top; | ||
padding: 4px; | ||
width: 50%; | ||
background-color: #F1F1F1; | ||
line-height: 15px; | ||
} | ||
|
||
.code-comparison-code { | ||
font-family: Courier; | ||
background-color: #F9F9F9; | ||
} | ||
|
||
.code-comparison-highlight { | ||
background-color: #DDF1F7; | ||
border: 1px solid #00A5E3; | ||
line-height: 15px; | ||
} | ||
|
||
.tag-line { | ||
text-align: center; | ||
width: 100%; | ||
margin-top: 30px; | ||
font-size: 12px; | ||
} | ||
|
||
.tag-line a { | ||
color: #000000; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>GeneratorTest Coding Standards</h1> | ||
<a name="Standard-Element,-handling-of-HTML-tags" /> | ||
<h2>Standard Element, handling of HTML tags</h2> | ||
<p class="text">The use of <em>tags</em> in standard descriptions is allowed and their handling should be <em>safeguarded</em>. | ||
Other tags, like <a href="example.com">link</a>, <b>bold</bold>, <script></script> are not allowed and will be encoded for display when the HTML or Markdown report is used.</p> | ||
<div class="tag-line">Documentation generated on #REDACTED# by <a href="https://github.com/PHPCSStandards/PHP_CodeSniffer">PHP_CodeSniffer #VERSION#</a></div> | ||
</body> | ||
</html> |
7 changes: 7 additions & 0 deletions
7
tests/Core/Generators/Expectations/ExpectedOutputStandardEncoding.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# GeneratorTest Coding Standard | ||
|
||
## Standard Element, handling of HTML tags | ||
The use of *tags* in standard descriptions is allowed and their handling should be *safeguarded*. | ||
Other tags, like <a href="example.com">link</a>, <b>bold</bold>, <script></script> are not allowed and will be encoded for display when the HTML or Markdown report is used. | ||
|
||
Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) |
9 changes: 9 additions & 0 deletions
9
tests/Core/Generators/Expectations/ExpectedOutputStandardEncoding.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
-------------------------------------------------------------------------- | ||
| GENERATORTEST CODING STANDARD: STANDARD ELEMENT, HANDLING OF HTML TAGS | | ||
-------------------------------------------------------------------------- | ||
|
||
The use of *tags* in standard descriptions is allowed and their handling should be *safeguarded*. | ||
Other tags, like <a href="example.com">link</a>, <b>bold</bold>, <script></script> are not allowed | ||
and will be encoded for display when the HTML or Markdown report is used. | ||
|
81 changes: 81 additions & 0 deletions
81
tests/Core/Generators/Expectations/ExpectedOutputStandardIndent.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<html> | ||
<head> | ||
<title>GeneratorTest Coding Standards</title> | ||
<style> | ||
body { | ||
background-color: #FFFFFF; | ||
font-size: 14px; | ||
font-family: Arial, Helvetica, sans-serif; | ||
color: #000000; | ||
} | ||
|
||
h1 { | ||
color: #666666; | ||
font-size: 20px; | ||
font-weight: bold; | ||
margin-top: 0px; | ||
background-color: #E6E7E8; | ||
padding: 20px; | ||
border: 1px solid #BBBBBB; | ||
} | ||
|
||
h2 { | ||
color: #00A5E3; | ||
font-size: 16px; | ||
font-weight: normal; | ||
margin-top: 50px; | ||
} | ||
|
||
.code-comparison { | ||
width: 100%; | ||
} | ||
|
||
.code-comparison td { | ||
border: 1px solid #CCCCCC; | ||
} | ||
|
||
.code-comparison-title, .code-comparison-code { | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 12px; | ||
color: #000000; | ||
vertical-align: top; | ||
padding: 4px; | ||
width: 50%; | ||
background-color: #F1F1F1; | ||
line-height: 15px; | ||
} | ||
|
||
.code-comparison-code { | ||
font-family: Courier; | ||
background-color: #F9F9F9; | ||
} | ||
|
||
.code-comparison-highlight { | ||
background-color: #DDF1F7; | ||
border: 1px solid #00A5E3; | ||
line-height: 15px; | ||
} | ||
|
||
.tag-line { | ||
text-align: center; | ||
width: 100%; | ||
margin-top: 30px; | ||
font-size: 12px; | ||
} | ||
|
||
.tag-line a { | ||
color: #000000; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>GeneratorTest Coding Standards</h1> | ||
<a name="Standard-Element,-indentation-should-be-ignored" /> | ||
<h2>Standard Element, indentation should be ignored</h2> | ||
<p class="text">This line has no indentation. | ||
This line has 4 spaces indentation. | ||
This line has 8 spaces indentation. | ||
This line has 4 spaces indentation.</p> | ||
<div class="tag-line">Documentation generated on #REDACTED# by <a href="https://github.com/PHPCSStandards/PHP_CodeSniffer">PHP_CodeSniffer #VERSION#</a></div> | ||
</body> | ||
</html> |
9 changes: 9 additions & 0 deletions
9
tests/Core/Generators/Expectations/ExpectedOutputStandardIndent.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# GeneratorTest Coding Standard | ||
|
||
## Standard Element, indentation should be ignored | ||
This line has no indentation. | ||
This line has 4 spaces indentation. | ||
This line has 8 spaces indentation. | ||
This line has 4 spaces indentation. | ||
|
||
Documentation generated on *REDACTED* by [PHP_CodeSniffer *VERSION*](https://github.com/PHPCSStandards/PHP_CodeSniffer) |
10 changes: 10 additions & 0 deletions
10
tests/Core/Generators/Expectations/ExpectedOutputStandardIndent.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
---------------------------------------------------------------------------------- | ||
| GENERATORTEST CODING STANDARD: STANDARD ELEMENT, INDENTATION SHOULD BE IGNORED | | ||
---------------------------------------------------------------------------------- | ||
|
||
This line has no indentation. | ||
This line has 4 spaces indentation. | ||
This line has 8 spaces indentation. | ||
This line has 4 spaces indentation. | ||
|
Oops, something went wrong.