Skip to content

Commit

Permalink
fix running test cases from browser
Browse files Browse the repository at this point in the history
  • Loading branch information
icewind1991 committed Jul 19, 2012
1 parent b30da61 commit e031b9b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
if(OC::$CLI){
$reporter=new TextReporter;
$test=isset($_SERVER['argv'][1])?$_SERVER['argv'][1]:false;
if($test=='xml')
{
if($test=='xml'){
$reporter= new XmlReporter;
$test=false;

Expand All @@ -42,7 +41,7 @@
}
}
}else{
$reporter='HtmlReporter';
$reporter=new HtmlReporter;
$test=isset($_GET['test'])?$_GET['test']:false;
}

Expand Down Expand Up @@ -81,10 +80,10 @@ function loadTests($dir,$testSuite, $test){
}elseif(substr($file,-4)=='.php' and $file!=__FILE__){
$name=getTestName($file);
if($test===false or $test==$name or substr($name,0,strlen($test))==$test){
$extractor = new SimpleFileLoader();
$extractor = new SimpleFileLoader();
$loadedSuite=$extractor->load($file);
if ($loadedSuite->getSize() > 0)
$testSuite->add($loadedSuite);
$testSuite->add($loadedSuite);
}
}
}
Expand Down

0 comments on commit e031b9b

Please sign in to comment.