parent
c70f738236
commit
a6af51f402
|
@ -378,7 +378,7 @@ class Config implements Countable, Iterator, ArrayAccess
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($default !== null) {
|
if ($value === null && $default !== null) {
|
||||||
$value = $default;
|
$value = $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -266,6 +266,11 @@ class ConfigTest extends BaseTestCase
|
||||||
$config->fromSection('a', 'c', 'test'),
|
$config->fromSection('a', 'c', 'test'),
|
||||||
'Config::fromSection does not return the given default value for non-existent section properties'
|
'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'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue