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])); } }