The behat test runner, if I may call it so, seems to use an error and exception handler which convert otherwise fatal exceptions (in my PHP code) to error messages like these:
[Semantical Error] line 0, col 18 near
'TimeTracking\Repository\WorkerIdentification': Error:
Class 'TimeTracking\Repository\WorkerIdentification'
is not defined. (Doctrine\ORM\Query\QueryException)
I have a semi elaborate setup for monitoring exceptions in the generic error_log that help me identify where the error occurs, and would very much appreciate to have Behat write the generated errors to the error_log, as defined in the php.ini.
Currently it is not writing anything to the error_log unless I explicitly call error_log(message)
.
Is there a way to define an event listener that echoes the original exception or error condition to the error log, or a configuration setting that can be tweaked to disable handling of errors and let fatal errors in the client / test code to terminate the PHP behat process?
I have looked at behat --help
and in the documentation, but I can not see any relevant info (the info on formatters refers you to "the documentation").