Example #1
0
function check_print_test_warn_row( $p_description, $p_pass, $p_info = null ) {
	global $g_alternate_row, $g_show_all;
	if ( !$g_show_all && $p_pass ) {
		return $p_pass;
	}
	echo "\t<tr>\n\t\t<td class=\"description$g_alternate_row\">$p_description";
	if( $p_info !== null) {
		if( is_array( $p_info ) && isset( $p_info[$p_pass] ) ) {
			echo '<br /><em>' . $p_info[$p_pass] . '</em>';
		} else if( !is_array( $p_info ) ) {
			echo '<br /><em>' . $p_info . '</em>';
		}
	}
	echo "</td>\n";
	if( $p_pass && !check_unhandled_errors_exist() ) {
		check_print_test_result( GOOD );
	} else if( !check_unhandled_errors_exist() ) {
		check_print_test_result( WARN );
	} else {
		check_print_test_result( BAD );
	}
	echo "\t</tr>\n";
	if( check_unhandled_errors_exist() ) {
		check_print_error_rows();
	}
	$g_alternate_row = $g_alternate_row === 1 ? 2 : 1;
	return $p_pass;
}
Example #2
0
/**
 * Print Check Test Warning Row
 * @param string  $p_description Description.
 * @param boolean $p_pass        Whether test passed.
 * @param string  $p_info        Information.
 * @return boolean
 */
function check_print_test_warn_row($p_description, $p_pass, $p_info = null)
{
    global $g_alternate_row, $g_show_all;
    $t_unhandled = check_unhandled_errors_exist();
    if (!$g_show_all && $p_pass && !$t_unhandled) {
        return $p_pass;
    }
    echo "\t<tr>\n\t\t<td class=\"description" . $g_alternate_row . '">' . $p_description;
    if ($p_info !== null) {
        if (is_array($p_info) && isset($p_info[$p_pass])) {
            echo '<br /><em>' . $p_info[$p_pass] . '</em>';
        } else {
            if (!is_array($p_info)) {
                echo '<br /><em>' . $p_info . '</em>';
            }
        }
    }
    echo "</td>\n";
    if ($p_pass && !$t_unhandled) {
        $t_result = GOOD;
    } elseif (!$t_unhandled || $t_unhandled == E_DEPRECATED) {
        $t_result = WARN;
    } else {
        $t_result = BAD;
    }
    check_print_test_result($t_result);
    echo "\t</tr>\n";
    if ($t_unhandled) {
        check_print_error_rows();
    }
    $g_alternate_row = $g_alternate_row === 1 ? 2 : 1;
    return $p_pass;
}