-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 5.4: [Messenger] Fix dealing with unexpected payload in Redis transport [Filesystem] Update some PHPDoc of the Path class [VarDumper] Fix dumping mysqli_driver instances Fix missing ReturnTypeWillChange attributes [Cache] Add missing log when saving namespace [HttpKernel] Reset services between requests performed by KernelBrowser [HttpKernel] Remove unused argument in ArgumentMetadataFactory [Stopwatch] Fix test expectation [SecurityBundle] fix autoconfiguring Monolog's ProcessorInterface KernelTestCase resets internal state on tearDown [Security/Http] Fix getting password-upgrader when user-loader is a closure [HttpKernel] Fix extracting controller name from closures [Intl] fix wrong offset timezone PHP 8.1 Fix type binding Remove duplicated test [Dotenv] Fix reading config for symfony/runtime when running dump command [Serializer] Remove unnecessary break [Runtime] Fix dotenv_overload with commands Make document type nodes ignorable Initialize Symfony\Component\Security\Core\Exception\AccountStatusException:: property
- Loading branch information
Showing
7 changed files
with
109 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
Tests/phpt/dotenv_overload_command_debug_exists_0_to_1.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
$_SERVER['DEBUG_ENABLED'] = '0'; | ||
$_SERVER['APP_RUNTIME_OPTIONS'] = [ | ||
'debug_var_name' => 'DEBUG_ENABLED', | ||
'dotenv_overload' => true, | ||
]; | ||
|
||
require __DIR__.'/autoload.php'; | ||
|
||
return static function (Command $command, OutputInterface $output, array $context): Command { | ||
return $command->setCode(static function () use ($output, $context): void { | ||
$output->writeln($context['DEBUG_ENABLED']); | ||
}); | ||
}; |
16 changes: 16 additions & 0 deletions
16
Tests/phpt/dotenv_overload_command_debug_exists_0_to_1.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--TEST-- | ||
Test Dotenv overload with a command when debug=0 exists and debug=1 in .env and the --no-debug option is not used | ||
--INI-- | ||
display_errors=1 | ||
--FILE-- | ||
<?php | ||
|
||
$_SERVER['argv'] = [ | ||
'my_app', | ||
]; | ||
$_SERVER['argc'] = 1; | ||
require $_SERVER['SCRIPT_FILENAME'] = __DIR__.'/dotenv_overload_command_debug_exists_0_to_1.php'; | ||
|
||
?> | ||
--EXPECTF-- | ||
1 |
18 changes: 18 additions & 0 deletions
18
Tests/phpt/dotenv_overload_command_debug_exists_1_to_0.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
$_SERVER['DEBUG_MODE'] = '1'; | ||
$_SERVER['APP_RUNTIME_OPTIONS'] = [ | ||
'debug_var_name' => 'DEBUG_MODE', | ||
'dotenv_overload' => true, | ||
]; | ||
|
||
require __DIR__.'/autoload.php'; | ||
|
||
return static function (Command $command, OutputInterface $output, array $context): Command { | ||
return $command->setCode(static function () use ($output, $context): void { | ||
$output->writeln($context['DEBUG_MODE']); | ||
}); | ||
}; |
16 changes: 16 additions & 0 deletions
16
Tests/phpt/dotenv_overload_command_debug_exists_1_to_0.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--TEST-- | ||
Test Dotenv overload with a command when debug=1 exists and debug=0 in .env and the --no-debug option is not used | ||
--INI-- | ||
display_errors=1 | ||
--FILE-- | ||
<?php | ||
|
||
$_SERVER['argv'] = [ | ||
'my_app', | ||
]; | ||
$_SERVER['argc'] = 1; | ||
require $_SERVER['SCRIPT_FILENAME'] = __DIR__.'/dotenv_overload_command_debug_exists_1_to_0.php'; | ||
|
||
?> | ||
--EXPECTF-- | ||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
$_SERVER['ENV_MODE'] = 'notfoo'; | ||
$_SERVER['APP_RUNTIME_OPTIONS'] = [ | ||
'env_var_name' => 'ENV_MODE', | ||
'dotenv_overload' => true, | ||
]; | ||
|
||
require __DIR__.'/autoload.php'; | ||
|
||
return static function (Command $command, OutputInterface $output, array $context): Command { | ||
return $command->setCode(static function () use ($output, $context): void { | ||
$output->writeln($context['ENV_MODE']); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--TEST-- | ||
Test Dotenv overload with a command when existing env=notfoo and env=foo in .env and the --env option is not used | ||
--INI-- | ||
display_errors=1 | ||
--FILE-- | ||
<?php | ||
|
||
$_SERVER['argv'] = [ | ||
'my_app', | ||
]; | ||
$_SERVER['argc'] = 1; | ||
require $_SERVER['SCRIPT_FILENAME'] = __DIR__.'/dotenv_overload_command_env_exists.php'; | ||
|
||
?> | ||
--EXPECTF-- | ||
foo |