diff --git a/apps/settings/tests/Mailer/NewUserMailHelperTest.php b/apps/settings/tests/Mailer/NewUserMailHelperTest.php index 87ad301dee71a..1a1fc20354b2d 100644 --- a/apps/settings/tests/Mailer/NewUserMailHelperTest.php +++ b/apps/settings/tests/Mailer/NewUserMailHelperTest.php @@ -146,8 +146,12 @@ public function testGenerateTemplateWithPasswordResetToken(): void { ->method('getName') ->willReturn('TestCloud'); $this->defaults - ->expects($this->any()) - ->method('getTextColorPrimary') + ->expects($this->atLeastOnce()) + ->method('getDefaultColorPrimary') + ->willReturn('#00679e'); + $this->defaults + ->expects($this->atLeastOnce()) + ->method('getDefaultTextColorPrimary') ->willReturn('#ffffff'); $expectedHtmlBody = << -
+
@@ -260,13 +264,13 @@ public function testGenerateTemplateWithPasswordResetToken(): void {
- +
-
+
@@ -496,13 +504,13 @@ public function testGenerateTemplateWithoutPasswordResetToken(): void {
-
- Set your password + + Set your password
@@ -382,8 +386,12 @@ public function testGenerateTemplateWithoutPasswordResetToken(): void { ->method('getName') ->willReturn('TestCloud'); $this->defaults - ->expects($this->any()) - ->method('getTextColorPrimary') + ->expects($this->atLeastOnce()) + ->method('getDefaultColorPrimary') + ->willReturn('#00679e'); + $this->defaults + ->expects($this->atLeastOnce()) + ->method('getDefaultTextColorPrimary') ->willReturn('#ffffff'); $expectedHtmlBody = <<
- +
-
+
@@ -721,13 +733,13 @@ public function testGenerateTemplateWithoutUserId(): void {
-
- Go to TestCloud + + Go to TestCloud
@@ -622,8 +630,12 @@ public function testGenerateTemplateWithoutUserId(): void { ->method('getName') ->willReturn('TestCloud'); $this->defaults - ->expects($this->any()) - ->method('getTextColorPrimary') + ->expects($this->atLeastOnce()) + ->method('getDefaultColorPrimary') + ->willReturn('#00679e'); + $this->defaults + ->expects($this->atLeastOnce()) + ->method('getDefaultTextColorPrimary') ->willReturn('#ffffff'); $expectedHtmlBody = <<
- +
-
- Go to TestCloud + + Go to TestCloud
diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php index 2cb222fd1373e..1d19f00b0a191 100644 --- a/lib/private/Mail/EMailTemplate.php +++ b/lib/private/Mail/EMailTemplate.php @@ -523,7 +523,7 @@ public function addBodyButtonGroup( $this->ensureBodyListClosed(); $color = $this->themingDefaults->getDefaultColorPrimary(); - $textColor = $this->themingDefaults->getTextColorPrimary(); + $textColor = $this->themingDefaults->getDefaultTextColorPrimary(); $this->htmlBody .= vsprintf($this->buttonGroup, [$color, $color, $urlLeft, $color, $textColor, $textColor, $textLeft, $urlRight, $textRight]); $this->plainBody .= PHP_EOL . $plainTextLeft . ': ' . $urlLeft . PHP_EOL; @@ -554,7 +554,7 @@ public function addBodyButton(string $text, string $url, $plainText = ''): void } $color = $this->themingDefaults->getDefaultColorPrimary(); - $textColor = $this->themingDefaults->getTextColorPrimary(); + $textColor = $this->themingDefaults->getDefaultTextColorPrimary(); $this->htmlBody .= vsprintf($this->button, [$color, $color, $url, $color, $textColor, $textColor, $text]); if ($plainText !== false) { diff --git a/tests/lib/Mail/EMailTemplateTest.php b/tests/lib/Mail/EMailTemplateTest.php index 76b37d48ff369..4943024043cb2 100644 --- a/tests/lib/Mail/EMailTemplateTest.php +++ b/tests/lib/Mail/EMailTemplateTest.php @@ -47,7 +47,7 @@ protected function setUp(): void { public function testEMailTemplateCustomFooter(): void { $this->defaults - ->expects($this->any()) + ->expects($this->atLeastOnce()) ->method('getDefaultColorPrimary') ->willReturn('#0082c9'); $this->defaults @@ -59,8 +59,8 @@ public function testEMailTemplateCustomFooter(): void { ->method('getName') ->willReturn('TestCloud'); $this->defaults - ->expects($this->any()) - ->method('getTextColorPrimary') + ->expects($this->atLeastOnce()) + ->method('getDefaultTextColorPrimary') ->willReturn('#ffffff'); $this->urlGenerator ->expects($this->once()) @@ -88,7 +88,7 @@ public function testEMailTemplateCustomFooter(): void { public function testEMailTemplateDefaultFooter(): void { $this->defaults - ->expects($this->any()) + ->expects($this->atLeastOnce()) ->method('getDefaultColorPrimary') ->willReturn('#0082c9'); $this->defaults @@ -104,8 +104,8 @@ public function testEMailTemplateDefaultFooter(): void { ->method('getLogo') ->willReturn('/img/logo-mail-header.png'); $this->defaults - ->expects($this->any()) - ->method('getTextColorPrimary') + ->expects($this->atLeastOnce()) + ->method('getDefaultTextColorPrimary') ->willReturn('#ffffff'); $this->urlGenerator ->expects($this->once()) @@ -131,7 +131,7 @@ public function testEMailTemplateDefaultFooter(): void { public function testEMailTemplateSingleButton(): void { $this->defaults - ->expects($this->any()) + ->expects($this->atLeastOnce()) ->method('getDefaultColorPrimary') ->willReturn('#0082c9'); $this->defaults @@ -147,8 +147,8 @@ public function testEMailTemplateSingleButton(): void { ->method('getLogo') ->willReturn('/img/logo-mail-header.png'); $this->defaults - ->expects($this->any()) - ->method('getTextColorPrimary') + ->expects($this->atLeastOnce()) + ->method('getDefaultTextColorPrimary') ->willReturn('#ffffff'); $this->urlGenerator ->expects($this->once()) @@ -176,7 +176,7 @@ public function testEMailTemplateSingleButton(): void { public function testEMailTemplateAlternativePlainTexts(): void { $this->defaults - ->expects($this->any()) + ->expects($this->atLeastOnce()) ->method('getDefaultColorPrimary') ->willReturn('#0082c9'); $this->defaults @@ -192,8 +192,8 @@ public function testEMailTemplateAlternativePlainTexts(): void { ->method('getLogo') ->willReturn('/img/logo-mail-header.png'); $this->defaults - ->expects($this->any()) - ->method('getTextColorPrimary') + ->expects($this->atLeastOnce()) + ->method('getDefaultTextColorPrimary') ->willReturn('#ffffff'); $this->urlGenerator ->expects($this->once())