From 74c304e9d9ebe3643f2376c15f8deea771feacf8 Mon Sep 17 00:00:00 2001 From: Daniel Klein Date: Sat, 21 Aug 2021 21:02:13 +1000 Subject: [PATCH] Put the columns in all reports in a consistent order for #827 - minor reformatting - split some files during one test to prevent a PCRE error --- .../Renderer/Template/coverage_bar.html.dist | 6 +- .../Template/coverage_bar_branch.html.dist | 6 +- .../Html/Renderer/Template/file.html.dist | 4 +- .../Renderer/Template/file_branch.html.dist | 8 +- .../Renderer/Template/file_item.html.dist | 14 +- .../Template/file_item_branch.html.dist | 26 +- .../Renderer/Template/method_item.html.dist | 9 +- .../Template/method_item_branch.html.dist | 21 +- .../BankAccount.php.html | 166 +++++----- .../HTML/CoverageForBankAccount/index.html | 42 +-- .../index.html | 42 +-- ...with_class_and_anonymous_function.php.html | 93 +++--- .../index.html | 28 +- .../source_with_ignore.php.html | 51 +-- .../BankAccount.php.html | 294 ++++++++++-------- .../BankAccount.php_branch.html | 294 ++++++++++-------- .../BankAccount.php_path.html | 294 ++++++++++-------- .../PathCoverageForBankAccount/index.html | 70 +++-- .../index.html | 56 ++-- .../source_without_namespace.php.html | 97 +++--- .../source_without_namespace.php_branch.html | 97 +++--- .../source_without_namespace.php_path.html | 97 +++--- tests/tests/HtmlTest.php | 38 ++- 23 files changed, 1039 insertions(+), 814 deletions(-) diff --git a/src/Report/Html/Renderer/Template/coverage_bar.html.dist b/src/Report/Html/Renderer/Template/coverage_bar.html.dist index 7fcf6f490..5401524bd 100644 --- a/src/Report/Html/Renderer/Template/coverage_bar.html.dist +++ b/src/Report/Html/Renderer/Template/coverage_bar.html.dist @@ -1,5 +1,7 @@ -
+ +
{{percent}}% covered ({{level}})
-
+
+ \ No newline at end of file diff --git a/src/Report/Html/Renderer/Template/coverage_bar_branch.html.dist b/src/Report/Html/Renderer/Template/coverage_bar_branch.html.dist index 7fcf6f490..5401524bd 100644 --- a/src/Report/Html/Renderer/Template/coverage_bar_branch.html.dist +++ b/src/Report/Html/Renderer/Template/coverage_bar_branch.html.dist @@ -1,5 +1,7 @@ -
+ +
{{percent}}% covered ({{level}})
-
+
+ \ No newline at end of file diff --git a/src/Report/Html/Renderer/Template/file.html.dist b/src/Report/Html/Renderer/Template/file.html.dist index 686b8b946..af8631d13 100644 --- a/src/Report/Html/Renderer/Template/file.html.dist +++ b/src/Report/Html/Renderer/Template/file.html.dist @@ -33,9 +33,9 @@   -
Classes and Traits
-
Functions and Methods
Lines
+
Functions and Methods
+
Classes and Traits
diff --git a/src/Report/Html/Renderer/Template/file_branch.html.dist b/src/Report/Html/Renderer/Template/file_branch.html.dist index ecbe62134..8717d7f9a 100644 --- a/src/Report/Html/Renderer/Template/file_branch.html.dist +++ b/src/Report/Html/Renderer/Template/file_branch.html.dist @@ -33,11 +33,11 @@   -
Classes and Traits
-
Functions and Methods
-
Paths
-
Branches
Lines
+
Branches
+
Paths
+
Functions and Methods
+
Classes and Traits
diff --git a/src/Report/Html/Renderer/Template/file_item.html.dist b/src/Report/Html/Renderer/Template/file_item.html.dist index dc754b3c6..b1c0fca48 100644 --- a/src/Report/Html/Renderer/Template/file_item.html.dist +++ b/src/Report/Html/Renderer/Template/file_item.html.dist @@ -1,14 +1,14 @@ - {{name}} - {{classes_bar}} -
{{classes_tested_percent}}
-
{{classes_number}}
+ {{name}} + {{lines_bar}} +
{{lines_executed_percent}}
+
{{lines_number}}
{{methods_bar}}
{{methods_tested_percent}}
{{methods_number}}
{{crap}} - {{lines_bar}} -
{{lines_executed_percent}}
-
{{lines_number}}
+ {{classes_bar}} +
{{classes_tested_percent}}
+
{{classes_number}}
diff --git a/src/Report/Html/Renderer/Template/file_item_branch.html.dist b/src/Report/Html/Renderer/Template/file_item_branch.html.dist index d7e479f62..505025179 100644 --- a/src/Report/Html/Renderer/Template/file_item_branch.html.dist +++ b/src/Report/Html/Renderer/Template/file_item_branch.html.dist @@ -1,20 +1,20 @@ - {{name}} - {{classes_bar}} -
{{classes_tested_percent}}
-
{{classes_number}}
+ {{name}} + {{lines_bar}} +
{{lines_executed_percent}}
+
{{lines_number}}
+ {{branches_bar}} +
{{branches_executed_percent}}
+
{{branches_number}}
+ {{paths_bar}} +
{{paths_executed_percent}}
+
{{paths_number}}
{{methods_bar}}
{{methods_tested_percent}}
{{methods_number}}
{{crap}} - {{paths_bar}} -
{{paths_executed_percent}}
-
{{paths_number}}
- {{branches_bar}} -
{{branches_executed_percent}}
-
{{branches_number}}
- {{lines_bar}} -
{{lines_executed_percent}}
-
{{lines_number}}
+ {{classes_bar}} +
{{classes_tested_percent}}
+
{{classes_number}}
diff --git a/src/Report/Html/Renderer/Template/method_item.html.dist b/src/Report/Html/Renderer/Template/method_item.html.dist index d8890ed27..2311d4564 100644 --- a/src/Report/Html/Renderer/Template/method_item.html.dist +++ b/src/Report/Html/Renderer/Template/method_item.html.dist @@ -1,11 +1,12 @@ - {{name}} + {{name}} + {{lines_bar}} +
{{lines_executed_percent}}
+
{{lines_number}}
{{methods_bar}}
{{methods_tested_percent}}
{{methods_number}}
{{crap}} - {{lines_bar}} -
{{lines_executed_percent}}
-
{{lines_number}}
+ diff --git a/src/Report/Html/Renderer/Template/method_item_branch.html.dist b/src/Report/Html/Renderer/Template/method_item_branch.html.dist index a6a25f95e..36d6cb741 100644 --- a/src/Report/Html/Renderer/Template/method_item_branch.html.dist +++ b/src/Report/Html/Renderer/Template/method_item_branch.html.dist @@ -1,17 +1,18 @@ - {{name}} + {{name}} + {{lines_bar}} +
{{lines_executed_percent}}
+
{{lines_number}}
+ {{branches_bar}} +
{{branches_executed_percent}}
+
{{branches_number}}
+ {{paths_bar}} +
{{paths_executed_percent}}
+
{{paths_number}}
{{methods_bar}}
{{methods_tested_percent}}
{{methods_number}}
{{crap}} - {{paths_bar}} -
{{paths_executed_percent}}
-
{{paths_number}}
- {{branches_bar}} -
{{branches_executed_percent}}
-
{{branches_number}}
- {{lines_bar}} -
{{lines_executed_percent}}
-
{{lines_number}}
+ diff --git a/tests/_files/Report/HTML/CoverageForBankAccount/BankAccount.php.html b/tests/_files/Report/HTML/CoverageForBankAccount/BankAccount.php.html index 646035749..06f38c39e 100644 --- a/tests/_files/Report/HTML/CoverageForBankAccount/BankAccount.php.html +++ b/tests/_files/Report/HTML/CoverageForBankAccount/BankAccount.php.html @@ -35,152 +35,170 @@   -
Classes and Traits
-
Functions and Methods
Lines
+
Functions and Methods
+
Classes and Traits
Total -
-
- 0.00% covered (danger) + +
+
+ 50.00% covered (danger)
-
- -
0.00%
-
0 / 1
-
+
+ +
50.00%
+
5 / 10
+ +
75.00% covered (warning)
-
- +
+
75.00%
3 / 4
CRAP -
-
- 50.00% covered (danger) + +
+
+ 0.00% covered (danger)
-
- -
50.00%
-
5 / 10
+
+ +
0.00%
+
0 / 1
BankAccount -
-
- 0.00% covered (danger) + +
+
+ 50.00% covered (danger)
-
- -
0.00%
-
0 / 1
-
+
+ +
50.00%
+
5 / 10
+ +
75.00% covered (warning)
-
- +
+
75.00%
3 / 4
8.12 -
-
- 50.00% covered (danger) + +
+
+ 0.00% covered (danger)
-
- -
50.00%
-
5 / 10
+
+ +
0.00%
+
0 / 1
-  getBalance -
+  getBalance + +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
- 1 -
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
+ 1 + -  setBalance -
+  setBalance + +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 1
- 6 -
+
0 / 5
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 5
+
0 / 1
+ 6 + -  depositMoney -
+  depositMoney + +
100.00% covered (success)
-
- +
+
100.00%
-
1 / 1
- 1 -
+
2 / 2
+ +
100.00% covered (success)
-
- +
+
100.00%
-
2 / 2
+
1 / 1
+ 1 + -  withdrawMoney -
+  withdrawMoney + +
100.00% covered (success)
-
- +
+
100.00%
-
1 / 1
- 1 -
+
2 / 2
+ +
100.00% covered (success)
-
- +
+
100.00%
-
2 / 2
+
1 / 1
+ 1 + diff --git a/tests/_files/Report/HTML/CoverageForBankAccount/index.html b/tests/_files/Report/HTML/CoverageForBankAccount/index.html index e0c9ed9d9..399a4089c 100644 --- a/tests/_files/Report/HTML/CoverageForBankAccount/index.html +++ b/tests/_files/Report/HTML/CoverageForBankAccount/index.html @@ -43,56 +43,62 @@ Total -
+ +
50.00% covered (danger)
-
- +
+
50.00%
5 / 10
-
+ +
75.00% covered (warning)
-
- +
+
75.00%
3 / 4
-
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
BankAccount.php -
+ +
50.00% covered (danger)
-
- +
+
50.00%
5 / 10
-
+ +
75.00% covered (warning)
-
- +
+
75.00%
3 / 4
-
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
diff --git a/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/index.html b/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/index.html index 222cec8c4..d849d87dd 100644 --- a/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/index.html +++ b/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/index.html @@ -43,56 +43,62 @@ Total -
+ +
88.89% covered (warning)
-
- +
+
88.89%
8 / 9
-
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
-
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
source_with_class_and_anonymous_function.php -
+ +
88.89% covered (warning)
-
- +
+
88.89%
8 / 9
-
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
-
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
diff --git a/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.html b/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.html index e0a83a0a3..65ace8313 100644 --- a/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.html +++ b/tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.html @@ -35,89 +35,98 @@   -
Classes and Traits
-
Functions and Methods
Lines
+
Functions and Methods
+
Classes and Traits
- Total -
+ Total + +
+
+ 88.89% covered (warning) +
+
+ +
88.89%
+
8 / 9
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
-
+ CRAP + +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
- CRAP -
+ + + + CoveredClassWithAnonymousFunctionInStaticMethod + +
88.89% covered (warning)
-
- +
+
88.89%
8 / 9
- - - - CoveredClassWithAnonymousFunctionInStaticMethod -
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
-
+ 1.00 + +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
- 1.00 -
+ + + +  runAnonymous + +
88.89% covered (warning)
-
- +
+
88.89%
8 / 9
- - - -  runAnonymous -
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
1.00 -
-
- 88.89% covered (warning) -
-
- -
88.89%
-
8 / 9
+ diff --git a/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/index.html b/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/index.html index 7d4cfffce..dd75dfbd1 100644 --- a/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/index.html +++ b/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/index.html @@ -43,20 +43,22 @@ Total -
+ +
50.00% covered (danger)
-
- +
+
50.00%
1 / 2
-
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
@@ -66,20 +68,22 @@ source_with_ignore.php -
+ +
50.00% covered (danger)
-
- +
+
50.00%
1 / 2
-
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
diff --git a/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/source_with_ignore.php.html b/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/source_with_ignore.php.html index d1218e2eb..492747e60 100644 --- a/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/source_with_ignore.php.html +++ b/tests/_files/Report/HTML/CoverageForFileWithIgnoredLines/source_with_ignore.php.html @@ -35,45 +35,48 @@   -
Classes and Traits
-
Functions and Methods
Lines
+
Functions and Methods
+
Classes and Traits
- Total - -
n/a
-
0 / 0
-
+ Total + +
+
+ 50.00% covered (danger) +
+
+ +
50.00%
+
1 / 2
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
CRAP -
-
- 50.00% covered (danger) -
-
- -
50.00%
-
1 / 2
+ +
n/a
+
0 / 0
- baz + baz
n/a
0 / 0
- 1
n/a
0 / 0
+ 1 + @@ -91,14 +94,15 @@ -  bar +  bar
n/a
0 / 0
- 1
n/a
0 / 0
+ 1 + @@ -116,14 +120,15 @@ -  foo +  foo
n/a
0 / 0
- 1
n/a
0 / 0
+ 1 + diff --git a/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php.html b/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php.html index 3847b4399..5bd0fde90 100644 --- a/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php.html +++ b/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php.html @@ -35,250 +35,280 @@   -
Classes and Traits
-
Functions and Methods
-
Paths
-
Branches
Lines
+
Branches
+
Paths
+
Functions and Methods
+
Classes and Traits
Total -
-
- 0.00% covered (danger) + +
+
+ 50.00% covered (danger)
-
- -
0.00%
-
0 / 1
-
-
- 75.00% covered (warning) +
+ +
50.00%
+
5 / 10
+ +
+
+ 42.86% covered (danger)
-
- -
75.00%
-
3 / 4
- CRAP -
+
+ +
42.86%
+
3 / 7
+ +
60.00% covered (warning)
-
- +
+
60.00%
3 / 5
-
-
- 42.86% covered (danger) + +
+
+ 75.00% covered (warning)
-
- -
42.86%
-
3 / 7
-
-
- 50.00% covered (danger) +
+ +
75.00%
+
3 / 4
+ CRAP + +
+
+ 0.00% covered (danger)
-
- -
50.00%
-
5 / 10
+
+ +
0.00%
+
0 / 1
BankAccount -
-
- 0.00% covered (danger) + +
+
+ 50.00% covered (danger)
-
- -
0.00%
-
0 / 1
-
-
- 75.00% covered (warning) +
+ +
50.00%
+
5 / 10
+ +
+
+ 42.86% covered (danger)
-
- -
75.00%
-
3 / 4
- 6.60 -
+
+ +
42.86%
+
3 / 7
+ +
60.00% covered (warning)
-
- +
+
60.00%
3 / 5
-
-
- 42.86% covered (danger) + +
+
+ 75.00% covered (warning)
-
- -
42.86%
-
3 / 7
-
-
- 50.00% covered (danger) +
+ +
75.00%
+
3 / 4
+ 6.60 + +
+
+ 0.00% covered (danger)
-
- -
50.00%
-
5 / 10
+
+ +
0.00%
+
0 / 1
-  getBalance -
+  getBalance + +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
- 1 -
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
+ 1 + -  setBalance -
+  setBalance + +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 1
- 6 -
+
0 / 5
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 2
-
+
0 / 4
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 4
-
+
0 / 2
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 5
+
0 / 1
+ 6 + -  depositMoney -
+  depositMoney + +
100.00% covered (success)
-
- +
+
100.00%
-
1 / 1
- 1 -
+
2 / 2
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
-
2 / 2
+
1 / 1
+ 1 + -  withdrawMoney -
+  withdrawMoney + +
100.00% covered (success)
-
- +
+
100.00%
-
1 / 1
- 1 -
+
2 / 2
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
-
2 / 2
+
1 / 1
+ 1 + diff --git a/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_branch.html b/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_branch.html index 7815dc9e9..fd9a898d0 100644 --- a/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_branch.html +++ b/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_branch.html @@ -35,250 +35,280 @@   -
Classes and Traits
-
Functions and Methods
-
Paths
-
Branches
Lines
+
Branches
+
Paths
+
Functions and Methods
+
Classes and Traits
Total -
-
- 0.00% covered (danger) + +
+
+ 50.00% covered (danger)
-
- -
0.00%
-
0 / 1
-
-
- 75.00% covered (warning) +
+ +
50.00%
+
5 / 10
+ +
+
+ 42.86% covered (danger)
-
- -
75.00%
-
3 / 4
- CRAP -
+
+ +
42.86%
+
3 / 7
+ +
60.00% covered (warning)
-
- +
+
60.00%
3 / 5
-
-
- 42.86% covered (danger) + +
+
+ 75.00% covered (warning)
-
- -
42.86%
-
3 / 7
-
-
- 50.00% covered (danger) +
+ +
75.00%
+
3 / 4
+ CRAP + +
+
+ 0.00% covered (danger)
-
- -
50.00%
-
5 / 10
+
+ +
0.00%
+
0 / 1
BankAccount -
-
- 0.00% covered (danger) + +
+
+ 50.00% covered (danger)
-
- -
0.00%
-
0 / 1
-
-
- 75.00% covered (warning) +
+ +
50.00%
+
5 / 10
+ +
+
+ 42.86% covered (danger)
-
- -
75.00%
-
3 / 4
- 6.60 -
+
+ +
42.86%
+
3 / 7
+ +
60.00% covered (warning)
-
- +
+
60.00%
3 / 5
-
-
- 42.86% covered (danger) + +
+
+ 75.00% covered (warning)
-
- -
42.86%
-
3 / 7
-
-
- 50.00% covered (danger) +
+ +
75.00%
+
3 / 4
+ 6.60 + +
+
+ 0.00% covered (danger)
-
- -
50.00%
-
5 / 10
+
+ +
0.00%
+
0 / 1
-  getBalance -
+  getBalance + +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
- 1 -
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
+ 1 + -  setBalance -
+  setBalance + +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 1
- 6 -
+
0 / 5
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 2
-
+
0 / 4
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 4
-
+
0 / 2
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 5
+
0 / 1
+ 6 + -  depositMoney -
+  depositMoney + +
100.00% covered (success)
-
- +
+
100.00%
-
1 / 1
- 1 -
+
2 / 2
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
-
2 / 2
+
1 / 1
+ 1 + -  withdrawMoney -
+  withdrawMoney + +
100.00% covered (success)
-
- +
+
100.00%
-
1 / 1
- 1 -
+
2 / 2
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
-
2 / 2
+
1 / 1
+ 1 + diff --git a/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_path.html b/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_path.html index 67cbe9943..a3be906ec 100644 --- a/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_path.html +++ b/tests/_files/Report/HTML/PathCoverageForBankAccount/BankAccount.php_path.html @@ -35,250 +35,280 @@   -
Classes and Traits
-
Functions and Methods
-
Paths
-
Branches
Lines
+
Branches
+
Paths
+
Functions and Methods
+
Classes and Traits
Total -
-
- 0.00% covered (danger) + +
+
+ 50.00% covered (danger)
-
- -
0.00%
-
0 / 1
-
-
- 75.00% covered (warning) +
+ +
50.00%
+
5 / 10
+ +
+
+ 42.86% covered (danger)
-
- -
75.00%
-
3 / 4
- CRAP -
+
+ +
42.86%
+
3 / 7
+ +
60.00% covered (warning)
-
- +
+
60.00%
3 / 5
-
-
- 42.86% covered (danger) + +
+
+ 75.00% covered (warning)
-
- -
42.86%
-
3 / 7
-
-
- 50.00% covered (danger) +
+ +
75.00%
+
3 / 4
+ CRAP + +
+
+ 0.00% covered (danger)
-
- -
50.00%
-
5 / 10
+
+ +
0.00%
+
0 / 1
BankAccount -
-
- 0.00% covered (danger) + +
+
+ 50.00% covered (danger)
-
- -
0.00%
-
0 / 1
-
-
- 75.00% covered (warning) +
+ +
50.00%
+
5 / 10
+ +
+
+ 42.86% covered (danger)
-
- -
75.00%
-
3 / 4
- 6.60 -
+
+ +
42.86%
+
3 / 7
+ +
60.00% covered (warning)
-
- +
+
60.00%
3 / 5
-
-
- 42.86% covered (danger) + +
+
+ 75.00% covered (warning)
-
- -
42.86%
-
3 / 7
-
-
- 50.00% covered (danger) +
+ +
75.00%
+
3 / 4
+ 6.60 + +
+
+ 0.00% covered (danger)
-
- -
50.00%
-
5 / 10
+
+ +
0.00%
+
0 / 1
-  getBalance -
+  getBalance + +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
- 1 -
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
+ 1 + -  setBalance -
+  setBalance + +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 1
- 6 -
+
0 / 5
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 2
-
+
0 / 4
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 4
-
+
0 / 2
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 5
+
0 / 1
+ 6 + -  depositMoney -
+  depositMoney + +
100.00% covered (success)
-
- +
+
100.00%
-
1 / 1
- 1 -
+
2 / 2
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
-
2 / 2
+
1 / 1
+ 1 + -  withdrawMoney -
+  withdrawMoney + +
100.00% covered (success)
-
- +
+
100.00%
-
1 / 1
- 1 -
+
2 / 2
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
1 / 1
-
+ +
100.00% covered (success)
-
- +
+
100.00%
-
2 / 2
+
1 / 1
+ 1 + diff --git a/tests/_files/Report/HTML/PathCoverageForBankAccount/index.html b/tests/_files/Report/HTML/PathCoverageForBankAccount/index.html index 8400c9b4b..211c5fbb7 100644 --- a/tests/_files/Report/HTML/PathCoverageForBankAccount/index.html +++ b/tests/_files/Report/HTML/PathCoverageForBankAccount/index.html @@ -45,88 +45,98 @@ Total -
+ +
50.00% covered (danger)
-
- +
+
50.00%
5 / 10
-
+ +
42.86% covered (danger)
-
- +
+
42.86%
3 / 7
-
+ +
60.00% covered (warning)
-
- +
+
60.00%
3 / 5
-
+ +
75.00% covered (warning)
-
- +
+
75.00%
3 / 4
-
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
BankAccount.php [line] [branch] [path] -
+ +
50.00% covered (danger)
-
- +
+
50.00%
5 / 10
-
+ +
42.86% covered (danger)
-
- +
+
42.86%
3 / 7
-
+ +
60.00% covered (warning)
-
- +
+
60.00%
3 / 5
-
+ +
75.00% covered (warning)
-
- +
+
75.00%
3 / 4
-
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
diff --git a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/index.html b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/index.html index b60a7d65b..93ec83f0b 100644 --- a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/index.html +++ b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/index.html @@ -45,36 +45,40 @@ Total -
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 5
-
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 4
-
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 2
-
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
@@ -84,36 +88,40 @@ source_without_namespace.php [line] [branch] [path] -
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 5
-
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 4
-
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 2
-
+ +
0.00% covered (danger)
-
- +
+
0.00%
0 / 1
diff --git a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php.html b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php.html index c0105b162..9fb82ced8 100644 --- a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php.html +++ b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php.html @@ -35,89 +35,98 @@   -
Classes and Traits
-
Functions and Methods
-
Paths
-
Branches
Lines
+
Branches
+
Paths
+
Functions and Methods
+
Classes and Traits
- Total - -
n/a
-
0 / 0
-
+ Total + +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 1
- CRAP -
+
0 / 5
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 2
-
+
0 / 4
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 4
-
+
0 / 2
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 5
+
0 / 1
+ CRAP + +
n/a
+
0 / 0
- foo -
+ foo + +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 1
- 6 -
+
0 / 5
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 2
-
+
0 / 4
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 4
-
+
0 / 2
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 5
+
0 / 1
+ 6 + @@ -128,13 +137,13 @@
n/a
0 / 0
- 0
n/a
0 / 0
n/a
0 / 0
+ 0
n/a
0 / 0
diff --git a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_branch.html b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_branch.html index 2fbee3406..96763c458 100644 --- a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_branch.html +++ b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_branch.html @@ -35,89 +35,98 @@   -
Classes and Traits
-
Functions and Methods
-
Paths
-
Branches
Lines
+
Branches
+
Paths
+
Functions and Methods
+
Classes and Traits
- Total - -
n/a
-
0 / 0
-
+ Total + +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 1
- CRAP -
+
0 / 5
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 2
-
+
0 / 4
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 4
-
+
0 / 2
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 5
+
0 / 1
+ CRAP + +
n/a
+
0 / 0
- foo -
+ foo + +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 1
- 6 -
+
0 / 5
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 2
-
+
0 / 4
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 4
-
+
0 / 2
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 5
+
0 / 1
+ 6 + @@ -128,13 +137,13 @@
n/a
0 / 0
- 0
n/a
0 / 0
n/a
0 / 0
+ 0
n/a
0 / 0
diff --git a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_path.html b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_path.html index aa088747f..048a955c8 100644 --- a/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_path.html +++ b/tests/_files/Report/HTML/PathCoverageForSourceWithoutNamespace/source_without_namespace.php_path.html @@ -35,89 +35,98 @@   -
Classes and Traits
-
Functions and Methods
-
Paths
-
Branches
Lines
+
Branches
+
Paths
+
Functions and Methods
+
Classes and Traits
- Total - -
n/a
-
0 / 0
-
+ Total + +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 1
- CRAP -
+
0 / 5
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 2
-
+
0 / 4
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 4
-
+
0 / 2
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 5
+
0 / 1
+ CRAP + +
n/a
+
0 / 0
- foo -
+ foo + +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 1
- 6 -
+
0 / 5
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 2
-
+
0 / 4
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 4
-
+
0 / 2
+ +
0.00% covered (danger)
-
- +
+
0.00%
-
0 / 5
+
0 / 1
+ 6 + @@ -128,13 +137,13 @@
n/a
0 / 0
- 0
n/a
0 / 0
n/a
0 / 0
+ 0
n/a
0 / 0
diff --git a/tests/tests/HtmlTest.php b/tests/tests/HtmlTest.php index 7f06548df..0d7e48ac5 100644 --- a/tests/tests/HtmlTest.php +++ b/tests/tests/HtmlTest.php @@ -53,7 +53,43 @@ public function testPathCoverageForBankAccountTest(): void $report = new Facade; $report->process($this->getPathCoverageForBankAccount(), self::$TEST_TMP_PATH); - $this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH); + // Prevent error: "preg_match(): Compilation failed: regular expression is too large at offset 35557" + $expectedFilesPath2 = self::$TEST_TMP_PATH . '2'; + if (!file_exists($expectedFilesPath2)){ + mkdir($expectedFilesPath2); + } + $paths = glob("{$expectedFilesPath2}/*"); + foreach ($paths as $path) { + unlink($path); + } + + $paths = glob("{$expectedFilesPath}/*"); + foreach ($paths as $path) { + $file = basename($path); + copy($path, "{$expectedFilesPath2}/{$file}"); + } + + foreach ( + [ + 'BankAccount.php_branch.html', + 'BankAccount.php_path.html', + ] as $file) { + foreach ([$expectedFilesPath2, self::$TEST_TMP_PATH] as $dir) { + $path = "{$dir}/{$file}"; + $lines = file($path); + $half = (int)(count($lines) / 2); + file_put_contents("{$path}.part1", join('', array_slice($lines, 0, $half))); + file_put_contents("{$path}.part2", join('', array_slice($lines, $half))); + unlink($path); + } + } + $this->assertFilesEquals($expectedFilesPath2, self::$TEST_TMP_PATH); + + $paths = glob("{$expectedFilesPath2}/*"); + foreach ($paths as $path) { + unlink($path); + } + rmdir($expectedFilesPath2); } public function testPathCoverageForSourceWithoutNamespace(): void