diff --git a/tests/lib/SimpleSAML/ConfigurationTest.php b/tests/lib/SimpleSAML/ConfigurationTest.php index fced577efb64dd1cf96700502e4939de9d402276..b644f0344292ed0711b470ca4343c5d3f58607a9 100644 --- a/tests/lib/SimpleSAML/ConfigurationTest.php +++ b/tests/lib/SimpleSAML/ConfigurationTest.php @@ -925,6 +925,27 @@ class Test_SimpleSAML_Configuration extends SimpleSAML\Test\Utils\ClearStateTest $c->getLocalizedString('opt'); } + /** + * Test SimpleSAML_Configuration::getConfig() nonexistent file + * @expectedException Exception + */ + public function testGetConfigNonexistentFile() { + SimpleSAML_Configuration::getConfig('nonexistent-nopreload.php'); + } + + /** + * Test SimpleSAML_Configuration::getConfig() preloaded nonexistent file + */ + public function testGetConfigNonexistentFilePreload() { + $c = SimpleSAML_Configuration::loadFromArray(array( + 'key' => 'value' + )); + $virtualFile = 'nonexistent-preload.php'; + SimpleSAML_Configuration::setPreLoadedConfig($c, $virtualFile); + $nc = SimpleSAML_Configuration::getConfig($virtualFile); + $this->assertEquals('value', $nc->getValue('key', null)); + } + /** * Test that Configuration objects can be initialized from an array. *