Task: #53687 Handle missing mode fallback and add no-mode cfg tests

This commit is contained in:
Alejandro Sosa 2026-03-26 09:31:07 +01:00
commit adf5a98768
5 changed files with 45 additions and 3 deletions

View file

@ -44,6 +44,25 @@ class CfgTest extends TestCase
$this->assertSame('218523', $cfg['auth']['projectId']);
}
public function testWriteWithoutModeFallsBackToDefaultMode(): void
{
file_put_contents(
$this->tmpDir.'/config/myCEESV.default.conf.php',
"<?php return [\n\t'auth' => [\n\t\t'projectId' => '',\n\t],\n];\n"
);
$result = $this->runCfg([
'-a',
$this->tmpDir,
'write',
'myCEESV',
'auth:projectId="218523"',
]);
$this->assertSame(0, $result['code'], $result['output']);
$this->assertFileExists($this->tmpDir.'/config/myCEESV.conf.php');
}
public function testWriteWithDirectoryNameCreatesAndWritesSiteConfig(): void
{
$result = $this->runCfg([