Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

36_exceptions_report_says_passes #51

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/DebbieRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -382,6 +385,9 @@ public function render_reports_html($path)
{
$total_failed++;
$failed++; //count the assert fail of each test per suite
$tests_type_fail[] = [
'case' => $test_case
];
}
else if ($assert_report['type'] == 'OK')
{
Expand All @@ -393,12 +399,14 @@ public function render_reports_html($path)
$tests_fatal_error[] = [
'case' => $test_case
];
$failed++;
}
else if ($assert_report['type'] == 'FAIL')
else if ($assert_report['type'] == 'EXCEPTION')
{
$tests_type_fail[] = [
$tests_fatal_error[] = [
'case' => $test_case
];
$failed++;
}
}
$total_asserts++;
Expand Down
4 changes: 3 additions & 1 deletion views/templates/menu_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
<?php foreach ($namesSuitessubmenu as $submenu): ?>
<?php $suites = explode("\\", $submenu); ?>
<?php if (in_array($item, $suites)): ?>
<?php if ($fatal_error == $suites[2] || $type_fail == $suites[2] || $is_failed) : ?>
<?php if ($fatal_error === $suites[2] || $type_fail === $suites[2]) : ?>
<?php $color = "red"; ?>
<?php else: ?>
<?php $color = "green"; ?>
<?php endif; ?>
<a id="<?=$suites[2]?>" class="text-truncate collapse-item" style="max-width: 175px; color:<?=$color?>" href="#" title="<?=$suites[2]?>"><?=$suites[2]?></a>
<?php endif; ?>
Expand Down