write some more tests
This commit is contained in:
parent
e8bb2b3eb1
commit
da100b85f5
2 changed files with 24 additions and 0 deletions
|
@ -27,6 +27,27 @@ use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
class SettingsTest extends 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()
|
public function testBuildFileName()
|
||||||
{
|
{
|
||||||
$path = './config/';
|
$path = './config/';
|
||||||
|
|
3
tests/config/VeruA.default.conf.php
Normal file
3
tests/config/VeruA.default.conf.php
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<?php return [
|
||||||
|
'mode' => 'test'
|
||||||
|
];
|
Loading…
Add table
Reference in a new issue