Fix that Config::fromSection cannot return the actual value

refs #7147
This commit is contained in:
Johannes Meyer 2014-11-11 15:51:54 +01:00
parent c70f738236
commit a6af51f402
2 changed files with 6 additions and 1 deletions

View File

@ -378,7 +378,7 @@ class Config implements Countable, Iterator, ArrayAccess
);
}
if ($default !== null) {
if ($value === null && $default !== null) {
$value = $default;
}

View File

@ -266,6 +266,11 @@ class ConfigTest extends BaseTestCase
$config->fromSection('a', 'c', 'test'),
'Config::fromSection does not return the given default value for non-existent section properties'
);
$this->assertEquals(
'c',
$config->fromSection('a', 'b', 'test'),
'Config::fromSection does not return the actual value of a section\'s property in case a default is given'
);
}
/**