write some more tests

This commit is contained in:
Norbert Wagner 2021-01-07 15:32:41 +01:00
parent e8bb2b3eb1
commit da100b85f5
2 changed files with 24 additions and 0 deletions

View file

@ -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/';

View file

@ -0,0 +1,3 @@
<?php return [
'mode' => 'test'
];