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

[PhpUnitBridge] Read --configuration directive #34300

Closed
ro0NL opened this issue Nov 8, 2019 · 1 comment
Closed

[PhpUnitBridge] Read --configuration directive #34300

ro0NL opened this issue Nov 8, 2019 · 1 comment

Comments

@ro0NL
Copy link
Contributor

ro0NL commented Nov 8, 2019

When running unit tests from within PhpStorm, i've run into an issue wherer the current working directory is controlled by PhpStorm (it switches to where the test is located).

This effectively breaks

if (file_exists('phpunit.xml')) {
$phpunitConfigFilename = 'phpunit.xml';
} elseif (file_exists('phpunit.xml.dist')) {
$phpunitConfigFilename = 'phpunit.xml.dist';

meaning my custom SYMFONY_PHPUNIT_VERSION is not detected.

PhpStorm invokes phpunit with the --configuration directive

/usr/bin/php /project/bin/phpunit \
  --bootstrap /project/config/bootstrap.php \
  --configuration /project/phpunit.xml.dist

Would be super cool if we detect --configurtation in the simple-phpunit wrapper to make it smooth :)

@ro0NL
Copy link
Contributor Author

ro0NL commented Nov 16, 2019

Alternatively, could we put putenv('SYMFONY_PHPUNIT_VERSION=8.4') in bin/phpunit at the recipe level? And remove it from phpunit.xml.dist

that's how i solve it currently

nicolas-grekas added a commit that referenced this issue Nov 28, 2019
This PR was merged into the 4.3 branch.

Discussion
----------

[PhpUnitBridge] Read configuration CLI directive

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34300
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Commits
-------

22931a0 [PhpUnitBridge] Read configuration CLI directive
fabpot added a commit that referenced this issue Jan 30, 2020
…iguration file (biozshock)

This PR was merged into the 4.3 branch.

Discussion
----------

[PhpUnitBridge] Properly handle phpunit arguments for configuration file

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT

PhpUnitBridge should properly parse cli arguments for configuration file.
After fixing #34300 the PhpUnitBridge stopped recognizing short `-c` option.
Also original PHPUnit allows to pass a directory as configuration parameter and read from either phpunit.xml or phpunit.xml.dist

Commits
-------

a7a5885 Properly handle phpunit arguments for configuration file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants