Skip to content

By-Pass Xdebug bug #331 by cleaning the filenames returned in the Xdebug.php driver #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

fabriceb
Copy link

Xdebug has an old bug which makes it return corrupted filenames in the code-coverage data in certain cases. Two identified cases:

  • using "assert"
  • using "runkit_function_redefine"

The returned filename will then be:
"[..]/wrongreturn.php(19) : assert code"
instead of
"[..]/wrongreturn.php"

The bug is documented here: http://bugs.xdebug.org/bug_view_page.php?bug_id=0000331

The suggested solution to by-pass this Xdebug bug until it is solved in Xdebug is to clean the filenames containing the pattern /(\d+) :.+/ which should normally be generic enough to solve all the possible cases.

The function to clean the filenames was put in the driver class to decouple Xdebug problems from the rest of the code coverage code.

Let me know if you have any suggestion on how to improve this.

@benja-M-1
Copy link

My html coverage now works !! Thanks

@hakre
Copy link
Contributor

hakre commented Aug 9, 2012

Please report it upstream. That 2007 Xdebug bugreport might have been just forgotten. First fix upstream, and only if not possible do the work-around.

@sebastianbergmann
Copy link
Owner

I agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants