not really working :/
This commit is contained in:
parent
428e843ac8
commit
a922237371
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace JHodges\GiteaBitPHPUnit;
|
||||
namespace JHodges\GiteaBotPHPUnit;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use PHPUnit\Framework\TestListener;
|
||||
@ -12,54 +12,34 @@ use Exception;
|
||||
|
||||
class Listener implements TestListener{
|
||||
|
||||
public function addWarning(Test $test, Warning $e, $time)
|
||||
{
|
||||
printf("Warning while running test '%s'.\n", $test->getName());
|
||||
private $stack=[];
|
||||
|
||||
public function addWarning(Test $test, Warning $e, $time){}
|
||||
|
||||
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time){}
|
||||
|
||||
public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time){}
|
||||
|
||||
public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time){}
|
||||
|
||||
public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time){}
|
||||
|
||||
public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time){}
|
||||
|
||||
public function startTest(PHPUnit_Framework_Test $test){}
|
||||
|
||||
public function endTest(PHPUnit_Framework_Test $test, $time){}
|
||||
|
||||
public function startTestSuite(PHPUnit_Framework_TestSuite $suite){
|
||||
$this->stack[$suite->getName()]='yes';
|
||||
}
|
||||
|
||||
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time)
|
||||
{
|
||||
printf("Error while running test '%s'.\n", $test->getName());
|
||||
}
|
||||
|
||||
public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
|
||||
{
|
||||
printf("Test '%s' failed.\n", $test->getName());
|
||||
}
|
||||
|
||||
public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time)
|
||||
{
|
||||
printf("Test '%s' is incomplete.\n", $test->getName());
|
||||
}
|
||||
|
||||
public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time)
|
||||
{
|
||||
printf("Test '%s' is deemed risky.\n", $test->getName());
|
||||
}
|
||||
|
||||
public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time)
|
||||
{
|
||||
printf("Test '%s' has been skipped.\n", $test->getName());
|
||||
}
|
||||
|
||||
public function startTest(PHPUnit_Framework_Test $test)
|
||||
{
|
||||
printf("Test '%s' started.\n", $test->getName());
|
||||
}
|
||||
|
||||
public function endTest(PHPUnit_Framework_Test $test, $time)
|
||||
{
|
||||
printf("Test '%s' ended.\n", $test->getName());
|
||||
}
|
||||
|
||||
public function startTestSuite(PHPUnit_Framework_TestSuite $suite)
|
||||
{
|
||||
printf("TestSuite '%s' started.\n", $suite->getName());
|
||||
}
|
||||
|
||||
public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
|
||||
{
|
||||
printf("TestSuite '%s' ended.\n", $suite->getName());
|
||||
public function endTestSuite(PHPUnit_Framework_TestSuite $suite){
|
||||
unset($this->stack[$suite->getName()]);
|
||||
if(count($this->stack)==0){
|
||||
echo "ALLDONE";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user