mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-11-09 02:13:38 +00:00
- 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
25 lines
873 B
PHP
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]));
|
|
}
|
|
}
|