I had the same problem (albeit on a LAMP server), since I completely rely on these line numbers along with screenshots to determine exactly what is happening in my tests. It is reported that the error, which I assume is such. See https://github.com/sebastianbergmann/phpunit-selenium/issues/81 for reference.
As a temporary temporary , I forcibly entered the line number in the error message in an exceptional case (because the line number, of course, can be found in the trace). As a side effect, most exceptions are overwritten, and I just throw a PHPUnit_Framework_Error, but at least I get the line number in the output. As a temporary workaround until this is fixed, this works for me.
To do this, I extend PHPUnit_Extensions_SeleniumTestCase with my own SeleniumTestCase and insert the following functions into it:
A very slightly modified version of this function for my own use: fooobar.com/questions/194564 / ...
protected function dumpStack(Exception $e) { $stack = ''; foreach ($e->getTrace() as $trace) { if (isset($trace['file']) && isset($trace['line']) && isset($trace['class']) && isset($trace['function'])) { $stack .= PHP_EOL . $trace['file'] . ':' . $trace['line'] . ' ' . $trace['class'] . '::' . $trace['function']; } } return $stack; }
I override onNotSuccessfulTest from PHPUnit_Extensions_SeleniumTestCase :
protected function onNotSuccessfulTest(Exception $e) { try { parent::onNotSuccessfulTest($e); } catch (PHPUnit_Framework_IncompleteTestError $e) { // Don't do anything with the incomplete test exception throw $e; } catch (PHPUnit_Framework_SkippedTestError $e) { // Don't do anything with the skipped test exception throw $e; } catch (Exception $e_parent) { // Include line number for specific test file in error $error_msg = chr(10).chr(10).$this->dumpStack($e); throw new PHPUnit_Framework_Error($e_parent->getMessage().$error_msg, $e_parent->getCode(), $e_parent->getFile(), $e_parent->getLine(), $e_parent->getTrace()); } }
I do not like this hack, so if someone has a better solution, I would be happy to hear it!
UPDATE: I forgot to mention this initially: you, of course, need to do tests that extend your own SeleniumTestCase, not PHPUnit_Extensions_SeleniumTestCase.