本文整理汇总了PHP中HtmlReporter类的典型用法代码示例。如果您正苦于以下问题:PHP HtmlReporter类的具体用法?PHP HtmlReporter怎么用?PHP HtmlReporter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HtmlReporter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CakeHtmlReporter
/**
* Does nothing yet. The first output will
* be sent on the first test start. For use
* by a web browser.
* @access public
*/
function CakeHtmlReporter($character_set = 'ISO-8859-1')
{
parent::HtmlReporter($character_set);
}
示例2: _getCss
/**
* Paints the CSS. Add additional styles here.
* @return string CSS code as text.
* @access protected
*/
function _getCss()
{
return HtmlReporter::_getCss() . " pre.source { font-family: monospace; white-space: pre; background-color: #eeeeec; }" . " span.lineNum { background-color: #e9b96e; }" . " span.lineCov { background-color: #8ae234; }" . " span.lineNoCov { background-color: #FAEA4F; }" . " span.lineDeadCode { background-color: #EF7B00; }" . " table#coverage th { background-color: #555752; color: white; text-align: center; padding: 0.1em 1em; }" . " table#coverage td.a { color: black; }" . " table#coverage td.low { background-color: #ef7b00; color: black; text-align: center; padding: 0.1em 1em; }" . " table#coverage td.medium { background-color: #faea4f; color: black; text-align: center; padding: 0.1em 1em; }" . " table#coverage td.high { background-color: #8ee034; color: black; text-align: center; padding: 0.1em 1em; }" . " table#coverage td { background-color: #d4d7d0; color: black; text-align: left; padding: 0.1em 1em; }";
}
示例3: run
#!/usr/bin/php
<?php
class HtmlReporter
{
public function run()
{
$data = file_get_contents("php://stdin");
$data = json_decode($data, true);
echo $this->render("template.view.php", array('profiles' => $data['profiles'], 'meta' => $data['meta'], 'url' => 'https://github.com/makeusabrew/phpperf/'));
}
protected function highlight($str)
{
return str_replace("<?php ", "", highlight_string("<?php " . $str, true));
}
protected function microformat($value)
{
return $value * 1000000 . " μs";
}
protected function render($tpl, $vars)
{
foreach ($vars as $k => $v) {
$this->{$k} = $v;
}
ob_start();
include $tpl;
return ob_get_clean();
}
}
$reporter = new HtmlReporter();
$reporter->run();
示例4: __construct
function __construct($character_set = 'UTF-8')
{
parent::HtmlReporter($character_set);
}
示例5: CakeHtmlReporter
/**
* Does nothing yet. The first output will
* be sent on the first test start. For use
* by a web browser.
* @access public
*/
function CakeHtmlReporter($characterSet = 'UTF-8')
{
parent::HtmlReporter($characterSet);
}
示例6: paintCaseEnd
function paintCaseEnd($test_name)
{
parent::paintCaseEnd($test_name);
// print_r($_GET);
// print_r($_POST);
// print_r($_REQUEST);
}
示例7:
/**
*
*/
function _getCss()
{
$contents = parent::_getCss() . "\n ";
$contents .= '
.bar { float: left; display: inline; border: 1px solid #eee; width: 300px; white-space: nowrap;}
.percentage { float: left; background-color: #eef; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 0.65em; padding: 5px; margin-right: }
.coverage {margin: 0.4em; }
.coverage a {
padding-left: 0.5em;
}
.coverage:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.coverage {display: inline-block;}
/* Hides from IE-mac \\*/
* html .coverage {height: 1%;}
.coverage {display: block;}
/* End hide from IE-mac */
';
return $contents;
}
示例8: paintPass
/**
* Called when a pass needs to be output.
*/
function paintPass($message)
{
//(Implicitly call grandparent, as parent not implemented.)
parent::paintPass($message);
if ($this->showpasses) {
$this->_paintPassFail('pass', $message);
}
}
示例9: alpha
function _getCss()
{
$result = parent::_getCss();
$result .= "\n.progress { margin: 1px; height: 20px; padding: 1px; border: 1px solid #000; width: 275px; " . "background: #fff; color: #000; float: left; clear: right; top: 75px; z-index: 9; }";
$result .= "\n.percents { background: #FFF; border: 1px solid #CCC; margin: 1px; height: 20px; " . "position:absolute; width:275px; z-index:10; left: 10px; top: 75px; text-align: center; }";
$result .= "\n.blocks { background: #EEE; border: 1px solid #CCC; margin: 1px; height: 20px; width: 10px; " . "position: absolute; z-index:11; left: 12px; top: 75px; " . "filter: alpha(opacity=50); -moz-opacity: 0.5; opacity: 0.5; -khtml-opacity: .5 }";
return $result;
}
示例10: paintPass
function paintPass($message)
{
parent::paintPass($message);
print "<span class=\"pass\">Pass</span>: ";
$breadcrumb = $this->getTestList();
array_shift($breadcrumb);
//print implode("->", $breadcrumb);
print "→ {$message}<br />\n";
}
示例11: paintPass
function paintPass($message)
{
parent::paintPass($message);
print '<span class="pass">Pass</span>: ';
$breadcrumb = $this->getTestList();
array_shift($breadcrumb);
print implode(" -> ", $breadcrumb);
print " -> {$message}<br />\n";
}
示例12: paintPass
function paintPass($message)
{
parent::paintPass($message);
$messageWithoutTrace = trim(substr($message, 0, strpos($message, " at [")));
if (strlen($messageWithoutTrace) == 0) {
// don't show empty messages (they appear if debugging is conditionally disabled)
return;
}
print "<span class=\"pass\">Pass</span>: ";
print "{$messageWithoutTrace}<br />\n";
}
示例13: getCss
protected function getCss()
{
return parent::getCss() . '
.pass {color:green;}
.subtle {color:#7B0000;}
h1 {display:none;}
h2,h3,h4{font-family:Verdana,Sans-serif;}
table {margin-bottom:0.5em;width:100%;}
tr {vertical-align:top;}
td.first {width:3em;}
';
}
示例14: paintGroupEnd
function paintGroupEnd($name)
{
$matches = array();
if (preg_match("#ext/(.*)/test.php#", $name, $matches)) {
$name = $matches[1];
$link = "<a href=\"" . make_link("test/{$name}") . "\">Test only this extension</a>";
}
parent::paintGroupEnd($name);
if ($this->current_html == "") {
$this->clear_modules[] = $name;
} else {
$this->current_html .= "<p>{$link}";
$this->page->add_block(new Block($name, $this->current_html, "main", 50));
$this->current_html = "";
}
}
示例15:
function _getCss()
{
return parent::_getCss() . " .pass { color: green; } \n" . " .fail { font-weight:bold; font-size:1.2em; }.\n";
}