[xdebug-general] Re: coverage not reported on code being executed

From: Derick Rethans <derick[@]xdebug.org>
Date: Thu, 6 Sep 2007 15:22:45 +0200 (CEST)

On Tue, 4 Sep 2007, Mark Slater wrote:

> Annoying problem: Our product is a web application. That means that some
> variables aren't filled in unless the code is in a web request. But when I try
> to have coverage reported over the whole product, it seems that XDebug tries
> to execute each line because it fails on things like:
> [PHP Error] Undefined index: SERVER_PORT [line # of /path/to/file.php]
> Is there anyway to get around that? Our unit tests are intended for offline
> execution, but if XDebug is going to insist that all lines be executable (even
> ones our tests won't actually touch) then it severely reduces our ability to
> use it outside a rather limited set of files.

Xdebug doesn't require anything to be done - in your unit tests PHP is
run, and if PHP gives a warning, Xdebug will see it as well. In our
Unittests we populate the $_SERVER global ourselves if our
code-to-be-tested depends on it.


Xdebug | http://xdebug.org | xdebug-general@lists.xdebug.org
Received on Thu Sep 06 2007 - 15:22:44 BST

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST