Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/notifications.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-10-27 16:55:50 +0300
committerJoas Schilling <coding@schilljs.com>2016-10-31 14:38:02 +0300
commit33f50d73457cb717d97c1a512dc9cfc8b2d5add3 (patch)
tree8fb747e93ed5a5a3ba01b014b00af1cef29f4a62 /tests/Unit
parent0fe86eedfaf0ac4d53ffac0c8f6d51648e7a2415 (diff)
Publish the rich object messages as well, although we don't use them
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/Unit')
-rw-r--r--tests/Unit/Controller/EndpointControllerTest.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/Unit/Controller/EndpointControllerTest.php b/tests/Unit/Controller/EndpointControllerTest.php
index e6fbf28..d0cc334 100644
--- a/tests/Unit/Controller/EndpointControllerTest.php
+++ b/tests/Unit/Controller/EndpointControllerTest.php
@@ -383,8 +383,8 @@ class EndpointControllerTest extends TestCase {
public function dataNotificationToArray() {
return [
- [42, 'app1', 'user1', 1234, 'type1', 42, 'subject1', '', [], 'message1', 'link1', 'icon1', [], []],
- [1337, 'app2', 'user2', 1337, 'type2', 21, 'subject2', 'richSubject 2', ['richSubject param'], 'message2', 'link2', 'icon2', [
+ [42, 'app1', 'user1', 1234, 'type1', 42, 'subject1', '', [], 'message1', 'richMessage 1', ['richMessage param'], 'link1', 'icon1', [], []],
+ [1337, 'app2', 'user2', 1337, 'type2', 21, 'subject2', 'richSubject 2', ['richSubject param'], 'message2', '', [], 'link2', 'icon2', [
$this->getMockBuilder(IAction::class)
->getMock(),
$this->getMockBuilder(IAction::class)
@@ -406,12 +406,14 @@ class EndpointControllerTest extends TestCase {
* @param string $subjectRich
* @param array $subjectRichParameters
* @param string $message
+ * @param string $messageRich
+ * @param array $messageRichParameters
* @param string $link
* @param string $icon
* @param array $actions
* @param array $actionsExpected
*/
- public function testNotificationToArray($id, $app, $user, $timestamp, $objectType, $objectId, $subject, $subjectRich, $subjectRichParameters, $message, $link, $icon, array $actions, array $actionsExpected) {
+ public function testNotificationToArray($id, $app, $user, $timestamp, $objectType, $objectId, $subject, $subjectRich, $subjectRichParameters, $message, $messageRich, $messageRichParameters, $link, $icon, array $actions, array $actionsExpected) {
$notification = $this->getMockBuilder(INotification::class)
->getMock();
@@ -454,6 +456,14 @@ class EndpointControllerTest extends TestCase {
->willReturn($message);
$notification->expects($this->once())
+ ->method('getRichMessage')
+ ->willReturn($messageRich);
+
+ $notification->expects($this->once())
+ ->method('getRichMessageParameters')
+ ->willReturn($messageRichParameters);
+
+ $notification->expects($this->once())
->method('getLink')
->willReturn($link);
@@ -483,6 +493,8 @@ class EndpointControllerTest extends TestCase {
'subjectRich' => $subjectRich,
'subjectRichParameters' => $subjectRichParameters,
'message' => $message,
+ 'messageRich' => $messageRich,
+ 'messageRichParameters' => $messageRichParameters,
'link' => $link,
'icon' => $icon,
'actions' => $actionsExpected,