diff options
author | Joas Schilling <coding@schilljs.com> | 2016-10-10 17:45:04 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-10-10 17:45:04 +0300 |
commit | bb713940afe0948b8b685ad0da1f731a653b0948 (patch) | |
tree | a7a24f9052666c0bf885c7da8149869b0256b9ee /tests/Unit | |
parent | 2e36dea4b0dee492700b9249add422f701a0d0d2 (diff) |
Fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/Unit')
-rw-r--r-- | tests/Unit/Controller/EndpointControllerTest.php | 12 | ||||
-rw-r--r-- | tests/Unit/HandlerTest.php | 4 |
2 files changed, 13 insertions, 3 deletions
diff --git a/tests/Unit/Controller/EndpointControllerTest.php b/tests/Unit/Controller/EndpointControllerTest.php index 4b8349d..978e827 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', [], []], - [1337, 'app2', 'user2', 1337, 'type2', 21, 'subject2', 'message2', 'link2', [ + [42, 'app1', 'user1', 1234, 'type1', 42, 'subject1', 'message1', 'link1', 'icon1', [], []], + [1337, 'app2', 'user2', 1337, 'type2', 21, 'subject2', 'message2', 'link2', 'icon2', [ $this->getMockBuilder(IAction::class) ->getMock(), $this->getMockBuilder(IAction::class) @@ -405,10 +405,11 @@ class EndpointControllerTest extends TestCase { * @param string $subject * @param string $message * @param string $link + * @param string $icon * @param array $actions * @param array $actionsExpected */ - public function testNotificationToArray($id, $app, $user, $timestamp, $objectType, $objectId, $subject, $message, $link, array $actions, array $actionsExpected) { + public function testNotificationToArray($id, $app, $user, $timestamp, $objectType, $objectId, $subject, $message, $link, $icon, array $actions, array $actionsExpected) { $notification = $this->getMockBuilder(INotification::class) ->getMock(); @@ -447,6 +448,10 @@ class EndpointControllerTest extends TestCase { ->willReturn($link); $notification->expects($this->once()) + ->method('getIcon') + ->willReturn($icon); + + $notification->expects($this->once()) ->method('getParsedActions') ->willReturn($actions); @@ -467,6 +472,7 @@ class EndpointControllerTest extends TestCase { 'subject' => $subject, 'message' => $message, 'link' => $link, + 'icon' => $icon, 'actions' => $actionsExpected, ], $this->invokePrivate($controller, 'notificationToArray', [$id, $notification]) diff --git a/tests/Unit/HandlerTest.php b/tests/Unit/HandlerTest.php index 806a967..8cbd529 100644 --- a/tests/Unit/HandlerTest.php +++ b/tests/Unit/HandlerTest.php @@ -62,6 +62,7 @@ class HandlerTest extends TestCase { 'getMessage' => 'message', 'getMessageParameters' => [], 'getLink' => 'link', + 'getIcon' => 'icon', 'getActions' => [ [ 'getLabel' => 'action_label', @@ -117,6 +118,7 @@ class HandlerTest extends TestCase { 'getMessage' => 'message', 'getMessageParameters' => [], 'getLink' => 'link', + 'getIcon' => 'icon', 'getActions' => [ [ 'getLabel' => 'action_label', @@ -207,6 +209,7 @@ class HandlerTest extends TestCase { 'getMessage' => '', 'getMessageParameters' => [], 'getLink' => '', + 'getIcon' => '', 'getActions' => [], ]; foreach ($defaultValues as $method => $returnValue) { @@ -227,6 +230,7 @@ class HandlerTest extends TestCase { 'setSubject', 'setMessage', 'setLink', + 'setIcon', 'addAction', ]; foreach ($defaultValues as $method) { |