On 3 May 2010 07:46, Christian Grobmeier <[email protected]> wrote:
> Are you working on this? If not I'll do. I think we should do this
> change soon before we all get confused with this error. Others
> reported it too, but for me everything is still fine :-)
I think I know why this works for you. Are you by any chance running
phpunit only on that one test class?
If you only run phpunit on this one class ("phpunit
renderers\LoggerRendererMapTest.php") you will *not* get the error.
You have to run all tests by running "phpunit" without parameters.
It took me a little while, but I know why this happens. The test which
fails uses Logger::resetConfiguration() to clear the previous settings
and appenders. However, the resetConfiguration() method does not reset
the LoggerAppenderPool. Next time configure() and initialize() is
called, instead of creating new appenders, the pool will use existing
ones. In this case, the htmlLineBreaks option is left turned on by a
previous test which uses the same appender name, and that is why the
test fails.
Just to prove the point, I implemented a method to clear the appender
pool (LoggerAppenderPool::clear()). When I edit
LoggerRendererMapTest::testUsage(), and add
LoggerAppenderPool::clear() before applying the new configuration, the
test passes as expected.
In conclusion, i think that:
* LoggerAppenderPool should have a clear() method
* this method should be called by Logger::resetConfiguration()
If you have the time, have a look at this problem, I'd like to finish
the echo appender issue first.
Regards,
Ivan