Valid: Lorem ipsum dolor sit amet. |
diff --git a/tests/Core/Generators/Expectations/ExpectedOutputOneDoc.html b/tests/Core/Generators/Expectations/ExpectedOutputOneDoc.html
index 30bcd76501..798ae63733 100644
--- a/tests/Core/Generators/Expectations/ExpectedOutputOneDoc.html
+++ b/tests/Core/Generators/Expectations/ExpectedOutputOneDoc.html
@@ -26,6 +26,19 @@
margin-top: 50px;
}
+ h2 a.sniffanchor,
+ h2 a.sniffanchor {
+ color: #006C95;
+ opacity: 0;
+ padding: 0 3px;
+ text-decoration: none;
+ font-weight: bold;
+ }
+ h2:hover a.sniffanchor,
+ h2:focus a.sniffanchor {
+ opacity: 1;
+ }
+
.code-comparison {
width: 100%;
}
@@ -75,8 +88,7 @@
GeneratorTest Coding Standards
-
- One Standard Block, No Code
+ One Standard Block, No Code §
Documentation contains one standard block and no code comparison.
diff --git a/tests/Core/Generators/Expectations/ExpectedOutputStandardBlankLines.html b/tests/Core/Generators/Expectations/ExpectedOutputStandardBlankLines.html
index b23f86921a..ceaab32a68 100644
--- a/tests/Core/Generators/Expectations/ExpectedOutputStandardBlankLines.html
+++ b/tests/Core/Generators/Expectations/ExpectedOutputStandardBlankLines.html
@@ -26,6 +26,19 @@
margin-top: 50px;
}
+ h2 a.sniffanchor,
+ h2 a.sniffanchor {
+ color: #006C95;
+ opacity: 0;
+ padding: 0 3px;
+ text-decoration: none;
+ font-weight: bold;
+ }
+ h2:hover a.sniffanchor,
+ h2:focus a.sniffanchor {
+ opacity: 1;
+ }
+
.code-comparison {
width: 100%;
}
@@ -75,8 +88,7 @@
GeneratorTest Coding Standards
-
- Standard Element, blank line handling
+ 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.
diff --git a/tests/Core/Generators/Expectations/ExpectedOutputStandardEncoding.html b/tests/Core/Generators/Expectations/ExpectedOutputStandardEncoding.html
index 09b98765e2..93a77d455c 100644
--- a/tests/Core/Generators/Expectations/ExpectedOutputStandardEncoding.html
+++ b/tests/Core/Generators/Expectations/ExpectedOutputStandardEncoding.html
@@ -26,6 +26,19 @@
margin-top: 50px;
}
+ h2 a.sniffanchor,
+ h2 a.sniffanchor {
+ color: #006C95;
+ opacity: 0;
+ padding: 0 3px;
+ text-decoration: none;
+ font-weight: bold;
+ }
+ h2:hover a.sniffanchor,
+ h2:focus a.sniffanchor {
+ opacity: 1;
+ }
+
.code-comparison {
width: 100%;
}
@@ -75,8 +88,7 @@
GeneratorTest Coding Standards
-
- 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.
diff --git a/tests/Core/Generators/Expectations/ExpectedOutputStandardIndent.html b/tests/Core/Generators/Expectations/ExpectedOutputStandardIndent.html
index a5ae0dbecf..8cf7c3419c 100644
--- a/tests/Core/Generators/Expectations/ExpectedOutputStandardIndent.html
+++ b/tests/Core/Generators/Expectations/ExpectedOutputStandardIndent.html
@@ -26,6 +26,19 @@
margin-top: 50px;
}
+ h2 a.sniffanchor,
+ h2 a.sniffanchor {
+ color: #006C95;
+ opacity: 0;
+ padding: 0 3px;
+ text-decoration: none;
+ font-weight: bold;
+ }
+ h2:hover a.sniffanchor,
+ h2:focus a.sniffanchor {
+ opacity: 1;
+ }
+
.code-comparison {
width: 100%;
}
@@ -75,8 +88,7 @@
GeneratorTest Coding Standards
-
- Standard Element, indentation should be ignored
+ Standard Element, indentation should be ignored §
This line has no indentation.
This line has 4 spaces indentation.
This line has 8 spaces indentation.
diff --git a/tests/Core/Generators/Expectations/ExpectedOutputStandardLineWrapping.html b/tests/Core/Generators/Expectations/ExpectedOutputStandardLineWrapping.html
index 66ebcb091f..b9f4038a1f 100644
--- a/tests/Core/Generators/Expectations/ExpectedOutputStandardLineWrapping.html
+++ b/tests/Core/Generators/Expectations/ExpectedOutputStandardLineWrapping.html
@@ -26,6 +26,19 @@
margin-top: 50px;
}
+ h2 a.sniffanchor,
+ h2 a.sniffanchor {
+ color: #006C95;
+ opacity: 0;
+ padding: 0 3px;
+ text-decoration: none;
+ font-weight: bold;
+ }
+ h2:hover a.sniffanchor,
+ h2:focus a.sniffanchor {
+ opacity: 1;
+ }
+
.code-comparison {
width: 100%;
}
@@ -75,8 +88,7 @@
GeneratorTest Coding Standards
-
- Standard Element, line wrapping handling
+ Standard Element, line wrapping handling §
This line has to be exactly 99 chars to test part of the logic.------------------------------------
And this line has to be exactly 100 chars.----------------------------------------------------------
And here we have a line which should start wrapping as it is longer than 100 chars. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pellentesque iaculis enim quis hendrerit. Morbi ultrices in odio pharetra commodo.
diff --git a/tests/Core/Generators/Expectations/ExpectedOutputStructureDocs.html b/tests/Core/Generators/Expectations/ExpectedOutputStructureDocs.html
index a7324d80fa..9aa1d6209b 100644
--- a/tests/Core/Generators/Expectations/ExpectedOutputStructureDocs.html
+++ b/tests/Core/Generators/Expectations/ExpectedOutputStructureDocs.html
@@ -26,6 +26,19 @@
margin-top: 50px;
}
+ h2 a.sniffanchor,
+ h2 a.sniffanchor {
+ color: #006C95;
+ opacity: 0;
+ padding: 0 3px;
+ text-decoration: none;
+ font-weight: bold;
+ }
+ h2:hover a.sniffanchor,
+ h2:focus a.sniffanchor {
+ opacity: 1;
+ }
+
.code-comparison {
width: 100%;
}
@@ -77,17 +90,16 @@
GeneratorTest Coding Standards
Table of Contents
- - No Content
- - Code Comparison Only, Missing Standard Block
- - One Standard Block, Code Comparison
- - One Standard Block, No Code
- - One Standard Block, Two Code Comparisons
- - Two Standard Blocks, No Code
- - Two Standard Blocks, One Code Comparison
- - Two Standard Blocks, Three Code Comparisons
+ - No Content
+ - Code Comparison Only, Missing Standard Block
+ - One Standard Block, Code Comparison
+ - One Standard Block, No Code
+ - One Standard Block, Two Code Comparisons
+ - Two Standard Blocks, No Code
+ - Two Standard Blocks, One Code Comparison
+ - Two Standard Blocks, Three Code Comparisons
-
- Code Comparison Only, Missing Standard Block
+ Code Comparison Only, Missing Standard Block §
Valid: Lorem ipsum dolor sit amet. |
@@ -98,8 +110,7 @@ Code Comparison Only, Missing Standard Block
class Comparison {} |
-
- One Standard Block, Code Comparison
+ One Standard Block, Code Comparison §
Documentation contains one standard block and one code comparison.
@@ -111,11 +122,9 @@ One Standard Block, Code Comparison
class Comparison {} |
-
- One Standard Block, No Code
+ One Standard Block, No Code §
Documentation contains one standard block and no code comparison.
-
- One Standard Block, Two Code Comparisons
+ One Standard Block, Two Code Comparisons §
Documentation contains one standard block and two code comparisons.
@@ -137,12 +146,10 @@ One Standard Block, Two Code Comparisons
$a = 10; |
-
- Two Standard Blocks, No Code
+ Two Standard Blocks, No Code §
This is standard block one.
This is standard block two.
-
- Two Standard Blocks, One Code Comparison
+ Two Standard Blocks, One Code Comparison §
This is standard block one.
@@ -155,8 +162,7 @@ Two Standard Blocks, One Code Comparison
This is standard block two.
-
- Two Standard Blocks, Three Code Comparisons
+ Two Standard Blocks, Three Code Comparisons §
This is standard block one.
diff --git a/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedOneElmAtWrongLevel.html b/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedOneElmAtWrongLevel.html
index ff1f5d842e..82fe75004f 100644
--- a/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedOneElmAtWrongLevel.html
+++ b/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedOneElmAtWrongLevel.html
@@ -26,6 +26,19 @@
margin-top: 50px;
}
+ h2 a.sniffanchor,
+ h2 a.sniffanchor {
+ color: #006C95;
+ opacity: 0;
+ padding: 0 3px;
+ text-decoration: none;
+ font-weight: bold;
+ }
+ h2:hover a.sniffanchor,
+ h2:focus a.sniffanchor {
+ opacity: 1;
+ }
+
.code-comparison {
width: 100%;
}
@@ -75,8 +88,7 @@
GeneratorTest Coding Standards
-
- One element correct, one element wrong level
+ One element correct, one element wrong level §
This is a standard block at the correct level.
diff --git a/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedSuperfluousCodeElement.html b/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedSuperfluousCodeElement.html
index 6cd60d0cac..de06568db9 100644
--- a/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedSuperfluousCodeElement.html
+++ b/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedSuperfluousCodeElement.html
@@ -26,6 +26,19 @@
margin-top: 50px;
}
+ h2 a.sniffanchor,
+ h2 a.sniffanchor {
+ color: #006C95;
+ opacity: 0;
+ padding: 0 3px;
+ text-decoration: none;
+ font-weight: bold;
+ }
+ h2:hover a.sniffanchor,
+ h2:focus a.sniffanchor {
+ opacity: 1;
+ }
+
.code-comparison {
width: 100%;
}
@@ -75,8 +88,7 @@
GeneratorTest Coding Standards
-
- Superfluous code element
+ Superfluous code element §
This is a standard block.
diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleToAnchorSlug1Standard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleToAnchorSlug1Standard.xml
new file mode 100644
index 0000000000..4edae6918d
--- /dev/null
+++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleToAnchorSlug1Standard.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleToAnchorSlug2Standard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleToAnchorSlug2Standard.xml
new file mode 100644
index 0000000000..43956e3fc0
--- /dev/null
+++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleToAnchorSlug2Standard.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleToAnchorSlug3Standard.xml b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleToAnchorSlug3Standard.xml
new file mode 100644
index 0000000000..43956e3fc0
--- /dev/null
+++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleToAnchorSlug3Standard.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/DocumentationTitleToAnchorSlug1Sniff.php b/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/DocumentationTitleToAnchorSlug1Sniff.php
new file mode 100644
index 0000000000..472e23648c
--- /dev/null
+++ b/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/DocumentationTitleToAnchorSlug1Sniff.php
@@ -0,0 +1,12 @@
+assertNotFalse($expected, 'Output expectation file could not be found');
+
+ // Make the test OS independent.
+ $expected = str_replace("\n", PHP_EOL, $expected);
+ $this->expectOutputString($expected);
+
+ $generator = new HTMLDouble($ruleset);
+ $generator->generate();
+
+ }//end testAnchorLinks()
+
+
/**
* Test the generated footer.
*