diff --git a/src/DebbieRun.php b/src/DebbieRun.php index 1280807..7cba59b 100644 --- a/src/DebbieRun.php +++ b/src/DebbieRun.php @@ -349,6 +349,9 @@ public function render_reports_html($path) $failed_Summ = ""; $succ_Summ = ""; $cards_summary_suites = ""; + $fatal_error = ''; + $type_fail = ''; + $is_failed = false; foreach ($this->reports as $i => $test_suite_reports) { @@ -382,6 +385,7 @@ public function render_reports_html($path) { $total_failed++; $failed++; //count the assert fail of each test per suite + $tests_type_fail[] = $test_case; } else if ($assert_report['type'] == 'OK') { @@ -390,15 +394,13 @@ public function render_reports_html($path) } else if ($assert_report['type'] == 'ERROR') // fatal error { - $tests_fatal_error[] = [ - 'case' => $test_case - ]; + $tests_fatal_error[] = $test_case; + $failed++; } - else if ($assert_report['type'] == 'FAIL') + else if ($assert_report['type'] == 'EXCEPTION') { - $tests_type_fail[] = [ - 'case' => $test_case - ]; + $tests_fatal_error[] = $test_case; + $failed++; } } $total_asserts++; @@ -467,14 +469,15 @@ public function render_reports_html($path) $badge = self::get_badge($item, $total_cases_failed, $total_cases_successful); $fatal_error = self::get_cases_with_fatal_err($item, $tests_fatal_error); $type_fail = self::get_type_fail($item, $tests_type_fail); - $menu_items .= self::template_report_html()->render('menu_items', [ 'item' => $item, 'is_failed' => $is_failed, 'namesSuitessubmenu' => $namesSuitessubmenu, 'badge' => $badge, 'fatal_error' => $fatal_error, - 'type_fail' => $type_fail + 'type_fail' => $type_fail, + 'tests_fatal_error' => $tests_fatal_error, + 'tests_type_fail' => $tests_type_fail ]); } } @@ -875,7 +878,7 @@ public function get_cases_with_fatal_err($item, $tests_fatal_error) $fatal_error_php = ''; foreach ($tests_fatal_error as $fatal) { - $suite_error = explode("\\", $fatal["case"]); + $suite_error = explode("\\", $fatal); if (array_search($item, $suite_error)) { $fatal_error_php = $suite_error[2]; @@ -889,7 +892,7 @@ public function get_type_fail($item, $tests_type_fail) $type_fail = ''; foreach ($tests_type_fail as $fail) { - $suite_error = explode("\\", $fail["case"]); + $suite_error = explode("\\", $fail); if (array_search($item, $suite_error)) { $type_fail = $suite_error[2]; diff --git a/tests/suite5/TestCase51.php b/tests/suite5/TestCase51.php new file mode 100644 index 0000000..55ca7eb --- /dev/null +++ b/tests/suite5/TestCase51.php @@ -0,0 +1,24 @@ +assert($a == 1, "This is happening"); + } + + public function test_this_is_another_test_5() + { + $a = 5; + + $this->assert($a == 5, "This is happening"); + } +} + +?> \ No newline at end of file diff --git a/tests/suite5/TestCase52.php b/tests/suite5/TestCase52.php new file mode 100644 index 0000000..8fd4fd7 --- /dev/null +++ b/tests/suite5/TestCase52.php @@ -0,0 +1,20 @@ +assert(true, "This is happening"); + } + + public function test_this_is_another_test_52() + { + $this->assert(true, "This is happening"); + } +} + +?> \ No newline at end of file diff --git a/tests/suite5/TestCase53.php b/tests/suite5/TestCase53.php new file mode 100644 index 0000000..159c08e --- /dev/null +++ b/tests/suite5/TestCase53.php @@ -0,0 +1,20 @@ +assert(true, "This is happening"); + } + + public function test_this_is_another_test_53() + { + $this->assert(false, "This is happening"); + } +} + +?> \ No newline at end of file diff --git a/views/templates/body_report.php b/views/templates/body_report.php index dea4432..76033fc 100644 --- a/views/templates/body_report.php +++ b/views/templates/body_report.php @@ -1,5 +1,5 @@