diff options
author | Michal Čihař <mcihar@suse.cz> | 2012-05-14 18:01:26 +0400 |
---|---|---|
committer | Michal Čihař <mcihar@suse.cz> | 2012-05-14 18:01:26 +0400 |
commit | 69f80f473bd1322d59f4460a423f3954be57048e (patch) | |
tree | dcbcd957c68a46947f0a9816cd995988a84ee610 /test | |
parent | de343ab837daabb12382eb05c0d09aaf557459ce (diff) |
More tests for loading config file
Diffstat (limited to 'test')
-rw-r--r-- | test/classes/PMA_Config_test.php | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/test/classes/PMA_Config_test.php b/test/classes/PMA_Config_test.php index 114901c760..7fdd522747 100644 --- a/test/classes/PMA_Config_test.php +++ b/test/classes/PMA_Config_test.php @@ -609,14 +609,37 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase /** * Tests loading of config file + * + * @param string $source File name of config to load + * @param boolean $result Expected result of loading + * + * @dataProvider configPaths */ - public function testLoad() + public function testLoad($source, $result) { - $this->assertFalse($this->object->load()); - - $this->assertTrue($this->object->load('./test/test_data/config.inc.php')); + if ($result) { + $this->assertTrue($this->object->load($source)); + } else { + $this->assertFalse($this->object->load($source)); + } + } - $this->assertTrue($this->object->load('./libraries/config.default.php')); + public function configPaths() + { + return array( + array( + './test/test_data/config.inc.php', + true, + ), + array( + './test/test_data/config-nonexisting.inc.php', + false, + ), + array( + './libraries/config.default.php', + true, + ), + ); } /** |