X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Futils%2FFakeConfigManager.php;h=014c2af0d8f1ae3179ad3d591cc494710bef6737;hb=495545f2f07f00ead911908d8bee9a572889eced;hp=85434de7b528861c436c430fff555013397dac95;hpb=91f17fc92a7168e2baf1096910b8f44f3a24a8a2;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/utils/FakeConfigManager.php b/tests/utils/FakeConfigManager.php index 85434de7..014c2af0 100644 --- a/tests/utils/FakeConfigManager.php +++ b/tests/utils/FakeConfigManager.php @@ -1,9 +1,13 @@ values[$key] = $value; } @@ -35,11 +39,23 @@ class FakeConfigManager * * @return mixed The value if set, else the name of the key */ - public function get($key) + public function get($key, $default = '') { if (isset($this->values[$key])) { return $this->values[$key]; } return $key; } + + /** + * Check if a setting exists + * + * @param string $setting Asked setting, keys separated with dots + * + * @return bool true if the setting exists, false otherwise + */ + public function exists($setting) + { + return array_key_exists($setting, $this->values); + } }