@@ -66,7 +66,9 @@ public function testTweetImage()
66
66
$ transport = $ this ->createTransport (new MockHttpClient ((function () {
67
67
yield function (string $ method , string $ url , array $ options ) {
68
68
$ 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 ' );
70
72
$ this ->assertArrayHasKey ('authorization ' , $ options ['normalized_headers ' ]);
71
73
72
74
return new MockResponse ('{"media_id_string":"gif123"} ' );
@@ -127,15 +129,19 @@ public function testTweetVideo()
127
129
$ transport = $ this ->createTransport (new MockHttpClient ((function () {
128
130
yield function (string $ method , string $ url , array $ options ) {
129
131
$ 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 ' );
131
135
$ this ->assertArrayHasKey ('authorization ' , $ options ['normalized_headers ' ]);
132
136
133
137
return new MockResponse ('{"media_id_string":"gif123"} ' );
134
138
};
135
139
136
140
yield function (string $ method , string $ url , array $ options ) {
137
141
$ 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 ' );
139
145
$ this ->assertArrayHasKey ('authorization ' , $ options ['normalized_headers ' ]);
140
146
141
147
return new MockResponse ('{"media_id_string":"sub234"} ' );
0 commit comments