@@ -114,7 +114,7 @@ public function testSendWithMercureOptions()
114
114
{
115
115
$ hub = new MockHub ('https://foo.com/.well-known/mercure ' , new StaticTokenProvider ('foo ' ), function (Update $ update ): string {
116
116
$ 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 ());
118
118
$ this ->assertSame ('id ' , $ update ->getId ());
119
119
$ this ->assertSame ('type ' , $ update ->getType ());
120
120
$ this ->assertSame (1 , $ update ->getRetry ());
@@ -123,14 +123,14 @@ public function testSendWithMercureOptions()
123
123
return 'id ' ;
124
124
});
125
125
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 ' ] )));
127
127
}
128
128
129
129
public function testSendWithMercureOptionsButWithoutOptionTopic ()
130
130
{
131
131
$ hub = new MockHub ('https://foo.com/.well-known/mercure ' , new StaticTokenProvider ('foo ' ), function (Update $ update ): string {
132
132
$ 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 ());
134
134
$ this ->assertSame ('id ' , $ update ->getId ());
135
135
$ this ->assertSame ('type ' , $ update ->getType ());
136
136
$ this ->assertSame (1 , $ update ->getRetry ());
@@ -146,7 +146,7 @@ public function testSendWithoutMercureOptions()
146
146
{
147
147
$ hub = new MockHub ('https://foo.com/.well-known/mercure ' , new StaticTokenProvider ('foo ' ), function (Update $ update ): string {
148
148
$ 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 ());
150
150
$ this ->assertFalse ($ update ->isPrivate ());
151
151
152
152
return 'id ' ;
0 commit comments