I'm using PHPUnit 3.4.14 and I'm trying to add a Listener.
I wrote a simple one:
class My_Test_Listener implements PHPUnit_Framework_TestListener
{
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time)
{
...
I declared it in my phpunit.xml file:
<phpunit bootstrap="./bootstrap.php">
<testsuites>
<testsuite name="auth">
<directory>./library/Ademe/Auth</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="Listener" file="./library/My/Test/Listener.php">
</listener>
</listeners>
</phpunit>
My class is loaded (if I omit to implement one of the method, it says so in the logs), but I never go inside thoses methods. I tried this for instance :
public function startTestSuite(PHPUnit_Framework_TestSuite $suite)
{
die('startTestSuite');
}
Do you have any idea of what could be missing?
Thanks!
OK I got it, the class name was wrong, allthough no error was reported. I should have done this instead:
<phpunit bootstrap="./bootstrap.php">
<testsuites>
<testsuite name="auth">
<directory>./library/Ademe/Auth</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="My_Test_Listener" file="./library/My/Test/Listener.php">
</listener>
</listeners>
</phpunit>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With