Skip to content

Commit 05da557

Browse files
Closes #2447
1 parent 6381a99 commit 05da557

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

ChangeLog-4.8.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes of the PHPUnit 4.8 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
44

5+
## [4.8.34] - 2017-MM-DD
6+
7+
* Fixed [#2447](https://github.com/sebastianbergmann/phpunit/issues/2447): Reverted backwards incompatible change to handling of boolean environment variable values specified in XML
8+
59
## [4.8.33] - 2017-01-25
610

711
### Fixed
@@ -237,6 +241,7 @@ New PHAR release due to updated dependencies
237241
* Made the argument check of `assertContains()` and `assertNotContains()` more strict to prevent undefined behavior such as [#1808](https://github.com/sebastianbergmann/phpunit/issues/1808)
238242
* Changed the name of the default group from `__nogroup__` to `default`
239243

244+
[4.8.34]: https://github.com/sebastianbergmann/phpunit/compare/4.8.33...4.8.34
240245
[4.8.33]: https://github.com/sebastianbergmann/phpunit/compare/4.8.32...4.8.33
241246
[4.8.32]: https://github.com/sebastianbergmann/phpunit/compare/4.8.31...4.8.32
242247
[4.8.31]: https://github.com/sebastianbergmann/phpunit/compare/4.8.30...4.8.31

src/Util/Configuration.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,7 @@ public function getPHPConfiguration()
473473
$name = (string) $var->getAttribute('name');
474474
$value = (string) $var->getAttribute('value');
475475

476-
if ($array !== 'env') {
477-
$result[$array][$name] = $this->getBoolean($value, $value);
478-
} else {
479-
$result[$array][$name] = $value;
480-
}
476+
$result[$array][$name] = $this->getBoolean($value, $value);
481477
}
482478
}
483479

tests/Util/ConfigurationTest.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public function testPHPConfigurationIsReadCorrectly()
277277
'ini' => array('foo' => 'bar'),
278278
'const' => array('FOO' => false, 'BAR' => true),
279279
'var' => array('foo' => false),
280-
'env' => array('foo' => 'true'),
280+
'env' => array('foo' => true),
281281
'post' => array('foo' => 'bar'),
282282
'get' => array('foo' => 'bar'),
283283
'cookie' => array('foo' => 'bar'),
@@ -302,8 +302,8 @@ public function testPHPConfigurationIsHandledCorrectly()
302302
$this->assertEquals(false, FOO);
303303
$this->assertEquals(true, BAR);
304304
$this->assertEquals(false, $GLOBALS['foo']);
305-
$this->assertEquals('true', $_ENV['foo']);
306-
$this->assertEquals('true', getenv('foo'));
305+
$this->assertEquals(true, $_ENV['foo']);
306+
$this->assertEquals(true, getenv('foo'));
307307
$this->assertEquals('bar', $_POST['foo']);
308308
$this->assertEquals('bar', $_GET['foo']);
309309
$this->assertEquals('bar', $_COOKIE['foo']);
@@ -319,11 +319,11 @@ public function testPHPConfigurationIsHandledCorrectly()
319319
*/
320320
public function testHandlePHPConfigurationDoesNotOverwrittenExistingEnvArrayVariables()
321321
{
322-
$_ENV['foo'] = 'false';
322+
$_ENV['foo'] = false;
323323
$this->configuration->handlePHPConfiguration();
324324

325-
$this->assertEquals('false', $_ENV['foo']);
326-
$this->assertEquals('true', getenv('foo'));
325+
$this->assertEquals(false, $_ENV['foo']);
326+
$this->assertEquals(true, getenv('foo'));
327327
}
328328

329329
/**
@@ -336,7 +336,7 @@ public function testHandlePHPConfigurationDoesNotOverriteVariablesFromPutEnv()
336336
putenv('foo=putenv');
337337
$this->configuration->handlePHPConfiguration();
338338

339-
$this->assertEquals('true', $_ENV['foo']);
339+
$this->assertEquals(true, $_ENV['foo']);
340340
$this->assertEquals('putenv', getenv('foo'));
341341
}
342342

0 commit comments

Comments
 (0)