send() public static method

Sends a string to output.
public static send ( string $string, string $type = null, boolean $newline = true ) : void
$string string Message to output
$type string Type of message for color generation if used.
$newline boolean Output line after string.
return void
Exemplo n.º 1
0
                            $lines++;
                        }
                        if ($_v >= 1) {
                            $total++;
                        }
                    }
                    $avg[$file] = round($total / $lines * 100, 2);
                } else {
                    $avg[$file] = 0;
                }
            }, $_file);
        }
        $total = 0.0;
        foreach ($avg as $_c) {
            $total += $_c;
        }
        \unittest\Output::send('--------------------', \unittest\Output::DEBUG, true);
        \unittest\Output::send(sprintf('Total Test Coverage : %s%%', round($total / (count($avg) * 100) * 100, 2)), \unittest\Output::DEBUG, true);
        \unittest\Output::send('--------------------', \unittest\Output::DEBUG, true);
        foreach ($avg as $_k => $_c) {
            \unittest\Output::send(sprintf('File : %s', $_k), \unittest\Output::DEBUG, true);
            \unittest\Output::send(sprintf('Coverage : %s%%', $_c), \unittest\Output::DEBUG, true);
            \unittest\Output::send('--------------------', \unittest\Output::DEBUG, true);
        }
    });
}
xp_import("unittest");
// load the standard unittest output
unittest\generate_output();
// make sure we save the event history
xp_set_signal_history(true);