Skip to content
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

Must provide --whitelist even when Xdebug whitelist script is used #3740

Closed
rask opened this issue Jun 27, 2019 · 2 comments
Closed

Must provide --whitelist even when Xdebug whitelist script is used #3740

rask opened this issue Jun 27, 2019 · 2 comments
Labels
feature/code-coverage Issues related to code coverage (but not php-code-coverage) type/enhancement A new idea that should be implemented

Comments

@rask
Copy link
Contributor

rask commented Jun 27, 2019

Q A
PHPUnit version 8.*
PHP version 7.3
Installation Method Any

When using Xdebug coverage filter via the --prepend argument, PHPUnit still requires the --whitelist argument in order to generate code coverage.

$ cat ./filter.php
<?php

\xdebug_set_filter(
    \XDEBUG_FILTER_CODE_COVERAGE,
    \XDEBUG_PATH_WHITELIST,
    ['/path/to/project/src']
);
$ phpunit --prepend=./filter.php ./tests/suite --coverage-html=./coverage
> ...
> Error: Incorrect whitelist config, no code coverage will be generated.
> ...

When I provide the --whitelist argument, it works:

$ phpunit --dump-xdebug-filter=./filter.php
$ phpunit --prepend=./filter.php ./tests/suite --coverage-html=./coverage --whitelist=/path/to/project/src
> ...

Or is this the way it is intended to work?

@sebastianbergmann
Copy link
Owner

At the moment, yes, this is the way it must be. Not sure we can remove the need for the redundancy here (in a robust way).

@sebastianbergmann sebastianbergmann added the type/enhancement A new idea that should be implemented label Jun 27, 2019
@sebastianbergmann sebastianbergmann added the feature/code-coverage Issues related to code coverage (but not php-code-coverage) label Feb 12, 2020
@sebastianbergmann
Copy link
Owner

I am closing this because of #4226 (and #4227).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/code-coverage Issues related to code coverage (but not php-code-coverage) type/enhancement A new idea that should be implemented
Projects
None yet
Development

No branches or pull requests

2 participants