Skip to content
Snippets Groups Projects
Commit 474506f5 authored by Dominic Benson's avatar Dominic Benson
Browse files

Test for preloading

Explicitly test a file that does not exist, as well as a preloaded one
Virtual test file names intented to be semantic but not collide.
parent 3d03f6d7
No related branches found
No related tags found
No related merge requests found
...@@ -925,6 +925,27 @@ class Test_SimpleSAML_Configuration extends SimpleSAML\Test\Utils\ClearStateTest ...@@ -925,6 +925,27 @@ class Test_SimpleSAML_Configuration extends SimpleSAML\Test\Utils\ClearStateTest
$c->getLocalizedString('opt'); $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. * Test that Configuration objects can be initialized from an array.
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment