File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,7 @@ public function notify(INotification $notification): void {
5454 $ notificationId = $ this ->handler ->add ($ notification );
5555
5656 try {
57- $ notificationToPush = $ this ->handler ->getById ($ notificationId , $ notification ->getUser ());
58- $ this ->push ->pushToDevice ($ notificationId , $ notificationToPush );
57+ $ this ->push ->pushToDevice ($ notificationId , $ notification );
5958 } catch (NotificationNotFoundException $ e ) {
6059 throw new \InvalidArgumentException ('Error while preparing push notification ' );
6160 }
Original file line number Diff line number Diff line change @@ -53,30 +53,21 @@ protected function setUp(): void {
5353
5454 public function dataNotify () {
5555 return [
56- [23 , ' user1 ' ],
57- [42 , ' user2 ' ],
56+ [23 ],
57+ [42 ],
5858 ];
5959 }
6060
6161 /**
6262 * @dataProvider dataNotify
6363 *
6464 * @param int $id
65- * @param string $user
6665 */
67- public function testNotify ($ id , $ user ) {
68- $ this ->notification ->expects ($ this ->once ())
69- ->method ('getUser ' )
70- ->willReturn ($ user );
71-
66+ public function testNotify ($ id ) {
7267 $ this ->handler ->expects ($ this ->once ())
7368 ->method ('add ' )
7469 ->with ($ this ->notification )
7570 ->willReturn ($ id );
76- $ this ->handler ->expects ($ this ->once ())
77- ->method ('getById ' )
78- ->with ($ id , $ user )
79- ->willReturn ($ this ->notification );
8071 $ this ->push ->expects ($ this ->once ())
8172 ->method ('pushToDevice ' )
8273 ->with ($ id , $ this ->notification );
You can’t perform that action at this time.
0 commit comments