Skip to content

Commit 11019fc

Browse files
committed
Use ::class keyword when possible
1 parent fdf2d8b commit 11019fc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Tests/HttpClientTraitTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,28 +193,28 @@ public function testAuthBearerOption()
193193

194194
public function testInvalidAuthBearerOption()
195195
{
196-
$this->expectException('Symfony\Component\HttpClient\Exception\InvalidArgumentException');
196+
$this->expectException(InvalidArgumentException::class);
197197
$this->expectExceptionMessage('Option "auth_bearer" must be a string, "object" given.');
198198
self::prepareRequest('POST', 'http://example.com', ['auth_bearer' => new \stdClass()], HttpClientInterface::OPTIONS_DEFAULTS);
199199
}
200200

201201
public function testInvalidAuthBearerValue()
202202
{
203-
$this->expectException('Symfony\Component\HttpClient\Exception\InvalidArgumentException');
203+
$this->expectException(InvalidArgumentException::class);
204204
$this->expectExceptionMessage('Invalid character found in option "auth_bearer": "a\nb".');
205205
self::prepareRequest('POST', 'http://example.com', ['auth_bearer' => "a\nb"], HttpClientInterface::OPTIONS_DEFAULTS);
206206
}
207207

208208
public function testSetAuthBasicAndBearerOptions()
209209
{
210-
$this->expectException('Symfony\Component\HttpClient\Exception\InvalidArgumentException');
210+
$this->expectException(InvalidArgumentException::class);
211211
$this->expectExceptionMessage('Define either the "auth_basic" or the "auth_bearer" option, setting both is not supported.');
212212
self::prepareRequest('POST', 'http://example.com', ['auth_bearer' => 'foo', 'auth_basic' => 'foo:bar'], HttpClientInterface::OPTIONS_DEFAULTS);
213213
}
214214

215215
public function testSetJSONAndBodyOptions()
216216
{
217-
$this->expectException('Symfony\Component\HttpClient\Exception\InvalidArgumentException');
217+
$this->expectException(InvalidArgumentException::class);
218218
$this->expectExceptionMessage('Define either the "json" or the "body" option, setting both is not supported');
219219
self::prepareRequest('POST', 'http://example.com', ['json' => ['foo' => 'bar'], 'body' => '<html/>'], HttpClientInterface::OPTIONS_DEFAULTS);
220220
}
@@ -256,14 +256,14 @@ public function testNormalizePeerFingerprint($fingerprint, $expected)
256256

257257
public function testNormalizePeerFingerprintException()
258258
{
259-
$this->expectException('Symfony\Component\HttpClient\Exception\InvalidArgumentException');
259+
$this->expectException(InvalidArgumentException::class);
260260
$this->expectExceptionMessage('Cannot auto-detect fingerprint algorithm for "foo".');
261261
$this->normalizePeerFingerprint('foo');
262262
}
263263

264264
public function testNormalizePeerFingerprintTypeException()
265265
{
266-
$this->expectException('Symfony\Component\HttpClient\Exception\InvalidArgumentException');
266+
$this->expectException(InvalidArgumentException::class);
267267
$this->expectExceptionMessage('Option "peer_fingerprint" must be string or array, "object" given.');
268268
$fingerprint = new \stdClass();
269269

0 commit comments

Comments
 (0)