@@ -29,9 +29,9 @@ class GoogleChatTransportTest extends TestCase
2929public function testToStringContainsProperties ():void
3030 {
3131$ transport =new GoogleChatTransport ('My-Space ' ,'theAccessKey ' ,'theAccessToken= ' ,$ this ->createMock (HttpClientInterface::class));
32- $ transport ->setHost (' testHost ' );
32+ $ transport ->setHost (null );
3333
34- $ this ->assertSame ('googlechat://theAccessKey:theAccessToken%3D@testHost /My-Space ' , (string )$ transport );
34+ $ this ->assertSame ('googlechat://theAccessKey:theAccessToken%3D@chat.googleapis.com /My-Space ' , (string )$ transport );
3535 }
3636
3737public function testSupportsChatMessage ():void
@@ -71,7 +71,9 @@ public function testSendWithEmptyArrayResponseThrows(): void
7171
7272$ transport =new GoogleChatTransport ('My-Space ' ,'theAccessKey ' ,'theAccessToken= ' ,$ client );
7373
74- $ transport ->send (new ChatMessage ('testMessage ' ));
74+ $ sentMessage =$ transport ->send (new ChatMessage ('testMessage ' ));
75+
76+ $ this ->assertSame ('spaces/My-Space/messages/abcdefg.hijklmno ' ,$ sentMessage ->getMessageId ());
7577 }
7678
7779public function testSendWithErrorResponseThrows ():void
@@ -93,7 +95,9 @@ public function testSendWithErrorResponseThrows(): void
9395
9496$ transport =new GoogleChatTransport ('My-Space ' ,'theAccessKey ' ,'theAccessToken= ' ,$ client );
9597
96- $ transport ->send (new ChatMessage ('testMessage ' ));
98+ $ sentMessage =$ transport ->send (new ChatMessage ('testMessage ' ));
99+
100+ $ this ->assertSame ('spaces/My-Space/messages/abcdefg.hijklmno ' ,$ sentMessage ->getMessageId ());
97101 }
98102
99103public function testSendWithOptions ():void
@@ -123,7 +127,9 @@ public function testSendWithOptions(): void
123127$ transport =new GoogleChatTransport ('My-Space ' ,'theAccessKey ' ,'theAccessToken= ' ,$ client );
124128$ transport ->setThreadKey ('My-Thread ' );
125129
126- $ transport ->send (new ChatMessage ('testMessage ' ));
130+ $ sentMessage =$ transport ->send (new ChatMessage ('testMessage ' ));
131+
132+ $ this ->assertSame ('spaces/My-Space/messages/abcdefg.hijklmno ' ,$ sentMessage ->getMessageId ());
127133 }
128134
129135public function testSendWithNotification ():void
@@ -153,7 +159,9 @@ public function testSendWithNotification(): void
153159
154160$ transport =new GoogleChatTransport ('My-Space ' ,'theAccessKey ' ,'theAccessToken= ' ,$ client );
155161
156- $ transport ->send ($ chatMessage );
162+ $ sentMessage =$ transport ->send ($ chatMessage );
163+
164+ $ this ->assertSame ('spaces/My-Space/messages/abcdefg.hijklmno ' ,$ sentMessage ->getMessageId ());
157165 }
158166
159167public function testSendWithInvalidOptions ():void
@@ -196,6 +204,8 @@ public function testSendWith200ResponseButNotOk(): void
196204
197205$ transport =new GoogleChatTransport ('My-Space ' ,'theAccessKey ' ,'theAccessToken= ' ,$ client );
198206
199- $ transport ->send (new ChatMessage ('testMessage ' ));
207+ $ sentMessage =$ transport ->send (new ChatMessage ('testMessage ' ));
208+
209+ $ this ->assertSame ('spaces/My-Space/messages/abcdefg.hijklmno ' ,$ sentMessage ->getMessageId ());
200210 }
201211}