Skip to content

[PhpUnitBridge] make PHPUnit environment variables configurable #18898

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 1 commit into from

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented May 26, 2016

Q A
Branch? 2.3
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Whenever I try to use Xdebug locally while executing the Symfony test suite, I have to modify the phpunit wrapper script to pass the XDEBUG_CONFIG variable to PHPUnit. With this change, one can create .phpunit.php files locally containing something like this instead:

<?php
return array(
    'XDEBUG_CONFIG' => 'remote_enable=1 remote_mode=req remote_port=9000 remote_host=127.0.0.1 remote_connect_back=0',
);

@nicolas-grekas
Copy link
Member

Why can't you do something like:
XDEBUG_CONFIG='remote_enable=1 remote_mode=req remote_port=9000 remote_host=127.0.0.1 remote_connect_back=0' ./phpunit?
proc_open forwards env vars to sub processes, isn't it?

@xabbuh
Copy link
Member Author

xabbuh commented May 27, 2016

@nicolas-grekas That doesn't seem to work. I am only able to debug the wrapper, but the env vars are not the same in the execute PHPUnit tests.

@nicolas-grekas
Copy link
Member

OK, then xdebug in the master process may be changing the env vars on purpose.
Then what about ?
XDEBUG_CONFIG='remote_enable=1 remote_mode=req remote_port=9000 remote_host=127.0.0.1 remote_connect_back=0' ./.phpunit/phpunit-4.8/phpunit ... (or 5.1 instead depending on your PHP version).

@xabbuh
Copy link
Member Author

xabbuh commented May 28, 2016

Ah indeed, that does work.

@xabbuh xabbuh closed this May 28, 2016
@xabbuh xabbuh deleted the phpunit-env branch May 28, 2016 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants