@@ -114,7 +114,7 @@ public function testSendWithMercureOptions()
114114 {
115115 $ hub = new MockHub ('https://foo.com/.well-known/mercure ' , new StaticTokenProvider ('foo ' ), function (Update $ update ): string {
116116 $ this ->assertSame (['/topic/1 ' , '/topic/2 ' ], $ update ->getTopics ());
117- $ this ->assertSame ('{"@context":"https:\/\/www.w3.org\/ns\/activitystreams","type":"Announce","summary":"subject"} ' , $ update ->getData ());
117+ $ this ->assertSame ('{"@context":"https:\/\/www.w3.org\/ns\/activitystreams","type":"Announce","summary":"subject","mediaType":"application\/json","content":{"tag":"1234","body":"TEST"} } ' , $ update ->getData ());
118118 $ this ->assertSame ('id ' , $ update ->getId ());
119119 $ this ->assertSame ('type ' , $ update ->getType ());
120120 $ this ->assertSame (1 , $ update ->getRetry ());
@@ -123,14 +123,14 @@ public function testSendWithMercureOptions()
123123 return 'id ' ;
124124 });
125125
126- self ::createTransport (null , $ hub )->send (new ChatMessage ('subject ' , new MercureOptions (['/topic/1 ' , '/topic/2 ' ], true , 'id ' , 'type ' , 1 )));
126+ self ::createTransport (null , $ hub )->send (new ChatMessage ('subject ' , new MercureOptions (['/topic/1 ' , '/topic/2 ' ], true , 'id ' , 'type ' , 1 , [ ' tag ' => ' 1234 ' , ' body ' => ' TEST ' ] )));
127127 }
128128
129129 public function testSendWithMercureOptionsButWithoutOptionTopic ()
130130 {
131131 $ hub = new MockHub ('https://foo.com/.well-known/mercure ' , new StaticTokenProvider ('foo ' ), function (Update $ update ): string {
132132 $ this ->assertSame (['https://symfony.com/notifier ' ], $ update ->getTopics ());
133- $ this ->assertSame ('{"@context":"https:\/\/www.w3.org\/ns\/activitystreams","type":"Announce","summary":"subject"} ' , $ update ->getData ());
133+ $ this ->assertSame ('{"@context":"https:\/\/www.w3.org\/ns\/activitystreams","type":"Announce","summary":"subject","mediaType":"application\/json","content":null } ' , $ update ->getData ());
134134 $ this ->assertSame ('id ' , $ update ->getId ());
135135 $ this ->assertSame ('type ' , $ update ->getType ());
136136 $ this ->assertSame (1 , $ update ->getRetry ());
@@ -146,7 +146,7 @@ public function testSendWithoutMercureOptions()
146146 {
147147 $ hub = new MockHub ('https://foo.com/.well-known/mercure ' , new StaticTokenProvider ('foo ' ), function (Update $ update ): string {
148148 $ this ->assertSame (['https://symfony.com/notifier ' ], $ update ->getTopics ());
149- $ this ->assertSame ('{"@context":"https:\/\/www.w3.org\/ns\/activitystreams","type":"Announce","summary":"subject"} ' , $ update ->getData ());
149+ $ this ->assertSame ('{"@context":"https:\/\/www.w3.org\/ns\/activitystreams","type":"Announce","summary":"subject","mediaType":"application\/json","content":null } ' , $ update ->getData ());
150150 $ this ->assertFalse ($ update ->isPrivate ());
151151
152152 return 'id ' ;
0 commit comments