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

Change PHPUnit env to server #561

Merged
1 commit merged into from
Apr 1, 2019
Merged

Change PHPUnit env to server #561

1 commit merged into from
Apr 1, 2019

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Apr 1, 2019

Q A
License MIT

/cc @nicolas-grekas

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request passes validation.

@fabpot
Copy link
Member Author

fabpot commented Apr 1, 2019

Needed as we are checking $_SERVER first in Symfony. So, using $_ENV here means that we can be in a situation where $_SERVER has been set first to dev and the PHPUnit sets $_ENV to test but it has no effect.

@ghost ghost merged commit defdbd7 into master Apr 1, 2019
ghost pushed a commit that referenced this pull request Apr 1, 2019
@chalasr chalasr deleted the env-vs-server branch April 1, 2019 15:52
fabpot added a commit to symfony/symfony that referenced this pull request Apr 24, 2019
…las-grekas)

This PR was merged into the 4.2 branch.

Discussion
----------

[PhpUnitBridge] fix reading phpunit.xml on bootstrap

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

Matches symfony/recipes#561

Commits
-------

1d55f80 [PhpUnitBridge] fix reading phpunit.xml on bootstrap
@fancyweb
Copy link
Contributor

I just got a problem with this change, since APP_ENV exists in $_SERVER, Dotenv does not set it in $_ENV (https://github.com/symfony/dotenv/blob/46a528ca327e0cb7fa7493a98ed3aebef8a516ac/Dotenv.php#L195), so $_ENV['APP_ENV'] does not exist when running the tests. Could we set both (server and env) in the phpunit config?

This pull request was closed.
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.

None yet

4 participants