diff --git a/tests/EventListener/AdminEmailTokenListenerTest.php b/tests/EventListener/AdminEmailTokenListenerTest.php index 0079180..afde8e0 100644 --- a/tests/EventListener/AdminEmailTokenListenerTest.php +++ b/tests/EventListener/AdminEmailTokenListenerTest.php @@ -7,7 +7,6 @@ use Contao\Config; use Contao\CoreBundle\Framework\ContaoFramework; use Contao\PageModel; -use Contao\StringUtil; use Contao\TestCase\ContaoTestCase; use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Component\HttpFoundation\Request; @@ -49,7 +48,7 @@ public function testAddsAdminTokens(string $configFriendlyEmail, string $pageFri $this->assertSame($expectedEmail, $tokenCollection->getByName('admin_email')->getValue()); } - public static function adminEmailProvider(): iterable + public static function adminEmailProvider(): \Generator { yield 'Basic admin email in config' => [ 'foobar-config@terminal42.ch', @@ -112,21 +111,8 @@ private function mockFrameworkWithAdminEmail(string|null $adminEmail = null): Co ->willReturn($adminEmail) ; - $stringUtilAdapter = $this->mockAdapter(['splitFriendlyEmail']); - $stringUtilAdapter - ->method('splitFriendlyEmail') - ->willReturnCallback( - static fn (string $email): array => match ($email) { - 'Lorem Ipsum [foobar-config@terminal42.ch]' => ['Lorem Ipsum', 'foobar-config@terminal42.ch'], - 'Dolor Sitamet [foobar@terminal42.ch]' => ['Dolor Sitamet', 'foobar@terminal42.ch'], - default => ['', $email], - }, - ) - ; - return $this->mockContaoFramework([ Config::class => $configAdapter, - StringUtil::class => $stringUtilAdapter, ]); } }