diff --git a/parts/result-set.php b/parts/result-set.php index b4f7bc1..4aa9211 100644 --- a/parts/result-set.php +++ b/parts/result-set.php @@ -35,7 +35,7 @@ $status = 'Errored'; $status_title = 'No results found for test.'; $results = get_post_meta( $report->ID, 'results', true ); - if ( isset( $results['failures'] ) ) { + if ( isset( $results['failures'] ) && ! empty( $results['tests'] ) ) { $status = 0 === (int) $results['failures'] && 0 === (int) $results['errors'] ? 'Passed' : 'Failed'; $status_title = (int) $results['tests'] . ' tests, ' . (int) $results['failures'] . ' failed, ' . (int) $results['errors'] . ' errors'; } diff --git a/parts/single-result.php b/parts/single-result.php index 2859e23..fc7b286 100644 --- a/parts/single-result.php +++ b/parts/single-result.php @@ -4,7 +4,7 @@ $status = 'Errored'; $status_title = 'No results found for test.'; $results = get_post_meta( $report->ID, 'results', true ); -if ( isset( $results['failures'] ) ) { +if ( isset( $results['failures'] ) && ! empty( $results['tests'] ) ) { $status = 0 === (int) $results['failures'] && 0 === (int) $results['errors'] ? 'Passed' : 'Failed'; $status_title = (int) $results['tests'] . ' tests, ' . (int) $results['failures'] . ' failed, ' . (int) $results['errors'] . ' errors'; }