diff --git a/tests/SettingsTest.php b/tests/SettingsTest.php index 1ee2e57..3a24b5a 100644 --- a/tests/SettingsTest.php +++ b/tests/SettingsTest.php @@ -27,6 +27,27 @@ use PHPUnit\Framework\TestCase; class SettingsTest extends TestCase { + public function testLoadNoFile() + { + $this->expectException(\ErrorException::class); + (new Settings())->load(); + } + + public function testLoad() + { + $cfg = (new Settings())->appPath(dirname(__FILE__).'/')->load(); + $this->assertNotEmpty($cfg); + return $cfg; + } + + /** + * @depends testLoad + */ + public function testMode(Settings $cfg) + { + $this->assertEquals('test', $cfg->mode); + } + public function testBuildFileName() { $path = './config/'; diff --git a/tests/config/VeruA.default.conf.php b/tests/config/VeruA.default.conf.php new file mode 100644 index 0000000..ded4c06 --- /dev/null +++ b/tests/config/VeruA.default.conf.php @@ -0,0 +1,3 @@ + 'test' +];