. * *///}}} declare(strict_types=1); namespace rabe\Util\tests; use rabe\Util\Settings; 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/'; $prefix = ''; $postfix = 'conf.php'; $type = ''; $defaultName = "$path$prefix$type$postfix"; $cfg = new Settings(); $this->assertEquals($defaultName, $cfg->buildFileName()); } } /* jEdit buffer local properties {{{ * :folding=explicit:collapseFolds=1: }}}*/