More unittests
This commit is contained in:
21
src/App.php
21
src/App.php
@ -37,14 +37,14 @@ class App
|
||||
'options' => Expect::arrayOf('string', 'string')
|
||||
]),
|
||||
'backup' => Expect::arrayOf(Expect::structure([
|
||||
'title' => Expect::string(),
|
||||
'source' => Expect::string(),
|
||||
'destination' => Expect::string(),
|
||||
])),
|
||||
'title' => Expect::string()->required(),
|
||||
'source' => Expect::string()->required(),
|
||||
'destination' => Expect::string()->required(),
|
||||
]))->required(),
|
||||
'notification' => Expect::arrayOf(Expect::structure([
|
||||
'type' => Expect::string(),
|
||||
'domain' => Expect::string(),
|
||||
'topic' => Expect::string(),
|
||||
'type' => Expect::string()->required(),
|
||||
'domain' => Expect::string()->required(),
|
||||
'topic' => Expect::string()->required(),
|
||||
])),
|
||||
'log' => Expect::string()->assert(
|
||||
function (string $path): bool {
|
||||
@ -53,17 +53,16 @@ class App
|
||||
),
|
||||
'templates' => Expect::structure(
|
||||
[
|
||||
'notify' => Expect::string(),
|
||||
'error' => Expect::string()
|
||||
'notify' => Expect::string()->required(),
|
||||
'error' => Expect::string()->required()
|
||||
]
|
||||
)
|
||||
)->required()
|
||||
]);
|
||||
|
||||
$parser = new Yaml();
|
||||
/** @var array<string, mixed> */
|
||||
$parsedConfig = $parser->parseFile($configFile);
|
||||
|
||||
|
||||
// Merge those values into the configuration schema:
|
||||
$this->config->merge($parsedConfig);
|
||||
|
||||
|
Reference in New Issue
Block a user