1
0
mirror of synced 2024-12-13 14:56:01 +03:00

fixing testrunner and cc report to look nicer

This commit is contained in:
meus 2007-09-02 20:05:48 +00:00
parent 70ff3b261f
commit 75f2364ed6
4 changed files with 16 additions and 36 deletions

View File

@ -8,3 +8,12 @@ class RelationTest extends Doctrine_Record
} }
} }
class RelationTestChild extends RelationTest
{
public function setUp()
{
$this->hasOne('RelationTest as Parent', 'RelationTestChild.child_id');
$this->ownsMany('RelationTestChild as Children', 'RelationTestChild.child_id');
}
}

View File

@ -1,10 +0,0 @@
<?php
class RelationTestChild extends RelationTest
{
public function setUp()
{
$this->hasOne('RelationTest as Parent', 'RelationTestChild.child_id');
$this->ownsMany('RelationTestChild as Children', 'RelationTestChild.child_id');
}
}

View File

@ -32,28 +32,7 @@ $reporter = new Doctrine_Coverage_Report("coverage.txt");
.red{ background: red;} .red{ background: red;}
.orange{ background: #f90;} .orange{ background: #f90;}
dl.table-display
{
margin: 2em 0;
padding: 0;
font-family: georgia, times, serif;
}
.table-display dt
{
float: left;
margin: 0 0 0 0;
padding: 0 .5em 0 .5em;
}
/* commented backslash hack for mac-ie5 \*/
dt { clear: both; }
/* end hack */
.table-display dd{
float: left;
margin: 0 0 0 0;
}
</style> </style>
</head> </head>
<body> <body>
@ -136,10 +115,10 @@ class Doctrine_Coverage_Report
} }
$coveredLines = $this->coverage[$key]; $coveredLines = $this->coverage[$key];
$fileArray = file(Doctrine::getPath() . "/".$fileName); $fileArray = file(Doctrine::getPath() . "/".$fileName);
$html .= '<dl class="table-display">' . "\n"; $html .= '<table>' . "\n";
foreach ($fileArray as $num => $line){ foreach ($fileArray as $num => $line){
$linenum = $num+1; $linenum = $num+1;
$html .= '<dt>' . $linenum . '</dt>' . "\n"; $html .= '<tr><td>' . $linenum . '</td>' . "\n";
$class ="normal"; $class ="normal";
if (isset($coveredLines[$linenum]) && $coveredLines[$linenum] == 1){ if (isset($coveredLines[$linenum]) && $coveredLines[$linenum] == 1){
$class = "covered"; $class = "covered";
@ -148,9 +127,11 @@ class Doctrine_Coverage_Report
} else if (isset($coveredLines[$linenum]) && $coveredLines[$linenum] == -2) { } else if (isset($coveredLines[$linenum]) && $coveredLines[$linenum] == -2) {
$class ="orange"; $class ="orange";
} }
$html .= '<dd class="' . $class . '">' . htmlspecialchars($line) . '</dd>' . "\n";
$line = str_replace(" ", "&nbsp;", htmlspecialchars($line));
$html .= '<td class="' . $class . '">' . $line . '</td></tr>' . "\n";
} }
$html .='</dl></div>'; $html .='</table></div>';
echo $html; echo $html;
} }

View File

@ -425,7 +425,7 @@ if (PHP_SAPI === "cli") {
$argv = $_SERVER["argv"]; $argv = $_SERVER["argv"];
$coverage = false; $coverage = false;
array_shift($argv); array_shift($argv);
if(isset($argv[1]) && $argv[1] == "coverage"){ if(isset($argv[0]) && $argv[0] == "coverage"){
array_shift($argv); array_shift($argv);
$coverage = true; $coverage = true;
} }