Skip to content

Commit

Permalink
Use absolute icon url (fix #280)
Browse files Browse the repository at this point in the history
  • Loading branch information
R0Wi committed Dec 1, 2024
1 parent 89dde04 commit b6c1770
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function prepare(INotification $notification, string $languageCode): INot
$message = $notification->getSubjectParameters()['message'];
$notification
->setParsedMessage($message)
->setIcon($this->urlGenerator->imagePath(Application::APP_NAME, 'app-dark.svg'));
->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath(Application::APP_NAME, 'app-dark.svg')));

return $notification;
}
Expand Down
16 changes: 16 additions & 0 deletions tests/Unit/Notification/NotifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ public function testPrepareConstructsOcrErrorCorrectlyWithFileId() {
$this->urlGenerator->expects($this->once())
->method('imagePath')
->with('workflow_ocr', 'app-dark.svg')
->willReturn('apps/workflow_ocr/app-dark.svg');
$this->urlGenerator->expects($this->once())
->method('getAbsoluteURL')
->with('apps/workflow_ocr/app-dark.svg')
->willReturn('http://localhost/index.php/apps/workflow_ocr/app-dark.svg');
$this->urlGenerator->expects($this->once())
->method('linkToRouteAbsolute')
Expand Down Expand Up @@ -204,6 +208,10 @@ public function testPrepareConstructsOcrErrorCorrectlyWithoutFile() {
$this->urlGenerator->expects($this->once())
->method('imagePath')
->with('workflow_ocr', 'app-dark.svg')
->willReturn('apps/workflow_ocr/app-dark.svg');
$this->urlGenerator->expects($this->once())
->method('getAbsoluteURL')
->with('apps/workflow_ocr/app-dark.svg')
->willReturn('http://localhost/index.php/apps/workflow_ocr/app-dark.svg');
$this->urlGenerator->expects($this->never())
->method('linkToRouteAbsolute');
Expand Down Expand Up @@ -251,6 +259,10 @@ public function testSendsFallbackNotificationWithoutFileInfoIfFileNotFoundWasThr
$this->urlGenerator->expects($this->once())
->method('imagePath')
->with('workflow_ocr', 'app-dark.svg')
->willReturn('apps/workflow_ocr/app-dark.svg');
$this->urlGenerator->expects($this->once())
->method('getAbsoluteURL')
->with('apps/workflow_ocr/app-dark.svg')
->willReturn('http://localhost/index.php/apps/workflow_ocr/app-dark.svg');
$this->logger->expects($this->once())
->method('error')
Expand Down Expand Up @@ -297,6 +309,10 @@ public function testSendsFallbackNotificationWithoutFileInfoIfReturnedFileArrayW
$this->urlGenerator->expects($this->once())
->method('imagePath')
->with('workflow_ocr', 'app-dark.svg')
->willReturn('apps/workflow_ocr/app-dark.svg');
$this->urlGenerator->expects($this->once())
->method('getAbsoluteURL')
->with('apps/workflow_ocr/app-dark.svg')
->willReturn('http://localhost/index.php/apps/workflow_ocr/app-dark.svg');
$this->logger->expects($this->once())
->method('warning')
Expand Down

0 comments on commit b6c1770

Please sign in to comment.