Files
mailcow-dockerized/tests/php/Backup/Legacy/NoTemplatesTest.php
T
FreddleSpl0it 6cf0390d58 [Web][Restic][Dovecot][Dockerapi] Add restic backups with restore in the UI
- Scheduled, encrypted backups to S3, SFTP, REST or a local folder (new restic-mailcow container)
- Restore of mailboxes and whole domains in the UI, also deleted ones, for admins and domain admins
- Scope set by RESTIC_BACKUP_MODE in mailcow.conf (all, data, config)
- Optional backup before updates (update.sh), helper-scripts/restic.sh for a full restore
2026-11-08 22:56:27 +01:00

25 lines
873 B
PHP

<?php
declare(strict_types=1);
namespace Mailcow\Tests\Backup\Legacy;
use Mailcow\Backup\Legacy\NoTemplates;
use Mailcow\MailboxGroup\Repository\LookupRepository;
use Mailcow\MailboxGroup\Service\TemplateService;
use PHPUnit\Framework\TestCase;
class NoTemplatesTest extends TestCase
{
public function testARestoredMembershipAppliesNoGroupTemplate(): void
{
$lookup = $this->createMock(LookupRepository::class);
// the mailbox gets a group with a template
$lookup->method('effectiveTemplates')->willReturn(['anna@firma.de' => 'Vertrieb']);
$lookup->method('mailboxNames')->willReturn(['anna@firma.de' => 'Anna']);
// the legacy mailbox code is never called (it is not loaded in the tests)
$this->assertSame([], (new TemplateService($lookup, new NoTemplates()))->applyChanged(['anna@firma.de' => null]));
}
}