-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Add support to environment variables APP_ENV/DEBUG in KernelTestCase #24177
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
Conversation
I guess fabbot failure (unrelated) should be fixed from |
); | ||
if (isset($options['environment'])) { | ||
$env = $options['environment']; | ||
} elseif (isset($_SERVER['APP_ENV']) || isset($_ENV['APP_ENV'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would split this in two:
if (isset($options['environment'])) {
$env = $options['environment'];
} elseif (isset($_SERVER['APP_ENV'])) {
$env = $_SERVER['APP_ENV'];
} elseif (isset($_ENV['APP_ENV'])) {
$env = $_ENV['APP_ENV'];
} else {
$env = 'test';
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Should we merge this one as a bugfix into the |
31d01c4
to
4e58195
Compare
As a bugfix should be into |
As env vars are "officially" supported since 3.3, I'd vote for a merge in 3.3 |
4e58195
to
8d56744
Compare
Done. |
Thank you @yceruto. |
…_ENV/DEBUG in KernelTestCase (yceruto) This PR was merged into the 3.3 branch. Discussion ---------- [FrameworkBundle] Add support to environment variables APP_ENV/DEBUG in KernelTestCase | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/recipes#170 (comment) | License | MIT | Doc PR | - /cc @fabpot Commits ------- 8d56744 Add support to environment variables APP_ENV/DEBUG in KernelTestCase
/cc @fabpot