@@ -176,39 +176,31 @@ public function testAuthBearerOption()
176
176
$ this ->assertSame (['Authorization: Bearer foobar ' ], $ options ['normalized_headers ' ]['authorization ' ]);
177
177
}
178
178
179
- /**
180
- * @expectedException \Symfony\Component\HttpClient\Exception\InvalidArgumentException
181
- * @expectedExceptionMessage Option "auth_bearer" must be a string containing only characters from the base 64 alphabet, object given.
182
- */
183
179
public function testInvalidAuthBearerOption ()
184
180
{
181
+ $ this ->expectException ('Symfony\Component\HttpClient\Exception\InvalidArgumentException ' );
182
+ $ this ->expectExceptionMessage ('Option "auth_bearer" must be a string containing only characters from the base 64 alphabet, object given. ' );
185
183
self ::prepareRequest ('POST ' , 'http://example.com ' , ['auth_bearer ' => new \stdClass ()], HttpClientInterface::OPTIONS_DEFAULTS );
186
184
}
187
185
188
- /**
189
- * @expectedException \Symfony\Component\HttpClient\Exception\InvalidArgumentException
190
- * @expectedExceptionMessage Option "auth_bearer" must be a string containing only characters from the base 64 alphabet, invalid string given.
191
- */
192
186
public function testInvalidAuthBearerValue ()
193
187
{
188
+ $ this ->expectException ('Symfony\Component\HttpClient\Exception\InvalidArgumentException ' );
189
+ $ this ->expectExceptionMessage ('Option "auth_bearer" must be a string containing only characters from the base 64 alphabet, invalid string given. ' );
194
190
self ::prepareRequest ('POST ' , 'http://example.com ' , ['auth_bearer ' => "a \nb " ], HttpClientInterface::OPTIONS_DEFAULTS );
195
191
}
196
192
197
- /**
198
- * @expectedException \Symfony\Component\HttpClient\Exception\InvalidArgumentException
199
- * @expectedExceptionMessage Define either the "auth_basic" or the "auth_bearer" option, setting both is not supported.
200
- */
201
193
public function testSetAuthBasicAndBearerOptions ()
202
194
{
195
+ $ this ->expectException ('Symfony\Component\HttpClient\Exception\InvalidArgumentException ' );
196
+ $ this ->expectExceptionMessage ('Define either the "auth_basic" or the "auth_bearer" option, setting both is not supported. ' );
203
197
self ::prepareRequest ('POST ' , 'http://example.com ' , ['auth_bearer ' => 'foo ' , 'auth_basic ' => 'foo:bar ' ], HttpClientInterface::OPTIONS_DEFAULTS );
204
198
}
205
199
206
- /**
207
- * @expectedException \Symfony\Component\HttpClient\Exception\InvalidArgumentException
208
- * @expectedExceptionMessage Define either the "json" or the "body" option, setting both is not supported
209
- */
210
200
public function testSetJSONAndBodyOptions ()
211
201
{
202
+ $ this ->expectException ('Symfony\Component\HttpClient\Exception\InvalidArgumentException ' );
203
+ $ this ->expectExceptionMessage ('Define either the "json" or the "body" option, setting both is not supported ' );
212
204
self ::prepareRequest ('POST ' , 'http://example.com ' , ['json ' => ['foo ' => 'bar ' ], 'body ' => '<html/> ' ], HttpClientInterface::OPTIONS_DEFAULTS );
213
205
}
214
206
@@ -247,21 +239,17 @@ public function testNormalizePeerFingerprint($fingerprint, $expected)
247
239
self ::assertSame ($ expected , $ this ->normalizePeerFingerprint ($ fingerprint ));
248
240
}
249
241
250
- /**
251
- * @expectedException \Symfony\Component\HttpClient\Exception\InvalidArgumentException
252
- * @expectedExceptionMessage Cannot auto-detect fingerprint algorithm for "foo".
253
- */
254
242
public function testNormalizePeerFingerprintException ()
255
243
{
244
+ $ this ->expectException ('Symfony\Component\HttpClient\Exception\InvalidArgumentException ' );
245
+ $ this ->expectExceptionMessage ('Cannot auto-detect fingerprint algorithm for "foo". ' );
256
246
$ this ->normalizePeerFingerprint ('foo ' );
257
247
}
258
248
259
- /**
260
- * @expectedException \Symfony\Component\HttpClient\Exception\InvalidArgumentException
261
- * @expectedExceptionMessage Option "peer_fingerprint" must be string or array, object given.
262
- */
263
249
public function testNormalizePeerFingerprintTypeException ()
264
250
{
251
+ $ this ->expectException ('Symfony\Component\HttpClient\Exception\InvalidArgumentException ' );
252
+ $ this ->expectExceptionMessage ('Option "peer_fingerprint" must be string or array, object given. ' );
265
253
$ fingerprint = new \stdClass ();
266
254
267
255
$ this ->normalizePeerFingerprint ($ fingerprint );
0 commit comments