8000 minor #28826 [Dotenv] Class should be case sensitive (xuanquynh) · symfony/symfony@ec32d43 · GitHub
[go: up one dir, main page]

Skip to content

Commit ec32d43

Browse files
committed
minor #28826 [Dotenv] Class should be case sensitive (xuanquynh)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #28826). Discussion ---------- [Dotenv] Class should be case sensitive | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | PHP 5.6 - 7.x allows to use case-insensitive with class's name but should we do? ```php namespace Example; class Application {} var_dump(class_exists(\Example\ApPlIcAtIoN::class)); // true var_dump(class_exists(\Example\APPLICATION::class)); // true ``` Commits ------- 6a0ab51 Class should be case sensitive
2 parents 80670fc + 6a0ab51 commit ec32d43

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Symfony/Component/Dotenv/Tests/DotenvTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function testLoad()
171171
file_put_contents($path1, 'FOO=BAR');
172172
file_put_contents($path2, 'BAR=BAZ');
173173

174-
(new DotEnv())->load($path1, $path2);
174+
(new Dotenv())->load($path1, $path2);
175175

176176
$foo = getenv('FOO');
177177
$bar = getenv('BAR');
@@ -199,7 +199,7 @@ public function testServerSuperglobalIsNotOverriden()
199199
{
200200
$originalValue = $_SERVER['argc'];
201201

202-
$dotenv = new DotEnv();
202+
$dotenv = new Dotenv();
203203
$dotenv->populate(array('argc' => 'new_value'));
204204

205205
$this->assertSame($originalValue, $_SERVER['argc']);
@@ -210,7 +210,7 @@ public function testEnvVarIsNotOverriden()
210210
putenv('TEST_ENV_VAR=original_value');
211211
$_SERVER['TEST_ENV_VAR'] = 'original_value';
212212

213-
$dotenv = new DotEnv();
213+
$dotenv = new Dotenv();
214214
$dotenv->populate(array('TEST_ENV_VAR' => 'new_value'));
215215

216216
$this->assertSame('original_value', getenv('TEST_ENV_VAR'));
@@ -220,7 +220,7 @@ public function testHttpVarIsPartiallyOverriden()
220220
{
221221
$_SERVER['HTTP_TEST_ENV_VAR'] = 'http_value';
222222

223-
$dotenv = new DotEnv();
223+
$dotenv = new Dotenv();
224224
$dotenv->populate(array('HTTP_TEST_ENV_VAR' => 'env_value'));
225225

226226
$this->assertSame('env_value', getenv('HTTP_TEST_ENV_VAR'));
@@ -242,7 +242,7 @@ public function testMemorizingLoadedVarsNamesInSpecialVar()
242242
unset($_SERVER['DATABASE_URL']);
243243
putenv('DATABASE_URL');
244244

245-
$dotenv = new DotEnv();
245+
$dotenv = new Dotenv();
246246
$dotenv->populate(array('APP_DEBUG' => '1', 'DATABASE_URL' => 'mysql://root@localhost/db'));
247247

248248
$this->assertSame('APP_DEBUG,DATABASE_URL', getenv('SYMFONY_DOTENV_VARS'));
@@ -259,7 +259,7 @@ public function testMemorizingLoadedVarsNamesInSpecialVar()
259259
unset($_SERVER['DATABASE_URL']);
260260
putenv('DATABASE_URL');
261261

262-
$dotenv = new DotEnv();
262+
$dotenv = new Dotenv();
263263
$dotenv->populate(array('APP_DEBUG' => '0', 'DATABASE_URL' => 'mysql://root@localhost/db'));
264264
$dotenv->populate(array('DATABASE_URL' => 'sqlite:///somedb.sqlite'));
265265

@@ -275,7 +275,7 @@ public function testOverridingEnvVarsWithNamesMemorizedInSpecialVar()
275275
putenv('BAZ=baz');
276276
putenv('DOCUMENT_ROOT=/var/www');
277277

278-
$dotenv = new DotEnv();
278+
$dotenv = new Dotenv();
279279
$dotenv->populate(array('FOO' => 'foo1', 'BAR' => 'bar1', 'BAZ' => 'baz1', 'DOCUMENT_ROOT' => '/boot'));
280280

281281
$this->assertSame('foo1', getenv('FOO'));

0 commit comments

Comments
 (0)
0