Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #31954 [PhpunitBridge] Read environment variable from superglobal…
…s (greg0ire) This PR was merged into the 4.3 branch. Discussion ---------- [PhpunitBridge] Read environment variable from superglobals | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #31857 | License | MIT | Doc PR | n/a The Dotenv component has recently been switched to using superglobals instead of putenv(). Let us support both and give priority to superglobals. Commits ------- 88cfcb5 [PhpunitBridge] Read environment variable from superglobals
- Loading branch information
Showing
4 changed files
with
57 additions
and
3 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
4 changes: 2 additions & 2 deletions
4
src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled.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
24 changes: 24 additions & 0 deletions
24
src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled_from_env_superglobal.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,24 @@ | ||
--TEST-- | ||
Test DeprecationErrorHandler in disabled mode (via putenv) | ||
--FILE-- | ||
<?php | ||
|
||
$_ENV['SYMFONY_DEPRECATIONS_HELPER'] = 'disabled'; | ||
putenv('ANSICON'); | ||
putenv('ConEmuANSI'); | ||
putenv('TERM'); | ||
|
||
$vendor = __DIR__; | ||
while (!file_exists($vendor.'/vendor')) { | ||
$vendor = dirname($vendor); | ||
} | ||
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php'); | ||
require PHPUNIT_COMPOSER_INSTALL; | ||
require_once __DIR__.'/../../bootstrap.php'; | ||
|
||
echo (int) set_error_handler('var_dump'); | ||
echo (int) class_exists('Symfony\Bridge\PhpUnit\DeprecationErrorHandler', false); | ||
|
||
?> | ||
--EXPECTF-- | ||
00 |
24 changes: 24 additions & 0 deletions
24
src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled_from_putenv.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,24 @@ | ||
--TEST-- | ||
Test DeprecationErrorHandler in disabled mode (via putenv) | ||
--FILE-- | ||
<?php | ||
|
||
putenv('SYMFONY_DEPRECATIONS_HELPER=disabled'); | ||
putenv('ANSICON'); | ||
putenv('ConEmuANSI'); | ||
putenv('TERM'); | ||
|
||
$vendor = __DIR__; | ||
while (!file_exists($vendor.'/vendor')) { | ||
$vendor = dirname($vendor); | ||
} | ||
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php'); | ||
require PHPUNIT_COMPOSER_INSTALL; | ||
require_once __DIR__.'/../../bootstrap.php'; | ||
|
||
echo (int) set_error_handler('var_dump'); | ||
echo (int) class_exists('Symfony\Bridge\PhpUnit\DeprecationErrorHandler', false); | ||
|
||
?> | ||
--EXPECTF-- | ||
00 |