@@ -66,7 +66,9 @@ public function testTweetImage()
6666 $ transport = $ this ->createTransport (new MockHttpClient ((function () {
6767 yield function (string $ method , string $ url , array $ options ) {
6868 $ this ->assertSame ('POST ' , $ method );
69- $ this ->assertSame ('https://upload.twitter.com/1.1/media/upload.json?command=INIT&total_bytes=185&media_type=image/gif&media_category=tweet_image ' , $ url );
69+ $ this ->assertSame ('https://upload.twitter.com/1.1/media/upload.json ' , $ url );
70+ $ this ->assertArrayHasKey ('body ' , $ options );
71+ $ this ->assertSame ($ options ['body ' ], 'command=INIT&total_bytes=185&media_type=image%2Fgif&media_category=tweet_image ' );
7072 $ this ->assertArrayHasKey ('authorization ' , $ options ['normalized_headers ' ]);
7173
7274 return new MockResponse ('{"media_id_string":"gif123"} ' );
@@ -127,15 +129,19 @@ public function testTweetVideo()
127129 $ transport = $ this ->createTransport (new MockHttpClient ((function () {
128130 yield function (string $ method , string $ url , array $ options ) {
129131 $ this ->assertSame ('POST ' , $ method );
130- $ this ->assertSame ('https://upload.twitter.com/1.1/media/upload.json?command=INIT&total_bytes=185&media_type=image/gif&media_category=tweet_video ' , $ url );
132+ $ this ->assertSame ('https://upload.twitter.com/1.1/media/upload.json ' , $ url );
133+ $ this ->assertArrayHasKey ('body ' , $ options );
134+ $ this ->assertSame ($ options ['body ' ], 'command=INIT&total_bytes=185&media_type=image%2Fgif&media_category=tweet_video ' );
131135 $ this ->assertArrayHasKey ('authorization ' , $ options ['normalized_headers ' ]);
132136
133137 return new MockResponse ('{"media_id_string":"gif123"} ' );
134138 };
135139
136140 yield function (string $ method , string $ url , array $ options ) {
137141 $ this ->assertSame ('POST ' , $ method );
138- $ this ->assertSame ('https://upload.twitter.com/1.1/media/upload.json?command=INIT&total_bytes=185&media_type=image/gif&media_category=subtitles ' , $ url );
142+ $ this ->assertSame ('https://upload.twitter.com/1.1/media/upload.json ' , $ url );
143+ $ this ->assertArrayHasKey ('body ' , $ options );
144+ $ this ->assertSame ($ options ['body ' ], 'command=INIT&total_bytes=185&media_type=image%2Fgif&media_category=subtitles ' );
139145 $ this ->assertArrayHasKey ('authorization ' , $ options ['normalized_headers ' ]);
140146
141147 return new MockResponse ('{"media_id_string":"sub234"} ' );
0 commit comments