I have setup phpunit. Now, whenever, an of my test case fails, I want to see the Test Class it belongs to.
For e.g.
class MyClass{
public function test1(){
}
}
Now, if test1 fails, I want its class name, i.e. "MyClass". This is my addFailure() function in listener class where I require the class of this test to be known.
public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) {
$this->_failures[] = $test->getName();
$this->failedTests.= $this->failedCounter.")"." <b>Test Name:</b> ".$test->getName()."<br />"."<b>Reason:</b> ".$test->getStatusMessage()."<br /><br />";
$this->failedCounter++;
}