|
8 | 8 | use GuzzleHttp\Psr7\Response;
|
9 | 9 | use Imgur\Api\Account;
|
10 | 10 | use Imgur\Client;
|
| 11 | +use Imgur\Exception\InvalidArgumentException; |
11 | 12 | use Imgur\HttpClient\HttpClient;
|
12 | 13 |
|
13 | 14 | class AccountTest extends ApiTestCase
|
14 | 15 | {
|
15 |
| - /** |
16 |
| - * @expectedException \Imgur\Exception\ErrorException |
17 |
| - * @expectedExceptionMessage Authentication required |
18 |
| - */ |
19 | 16 | public function testBaseReal()
|
20 | 17 | {
|
| 18 | + $this->expectException(\Imgur\Exception\ErrorException::class); |
| 19 | + $this->expectExceptionMessage('Authentication required'); |
| 20 | + |
21 | 21 | $guzzleClient = new GuzzleClient(['base_uri' => 'https://api.imgur.com/3/']);
|
22 | 22 | $httpClient = new HttpClient([], $guzzleClient);
|
23 | 23 | $client = new Client(null, $httpClient);
|
@@ -116,12 +116,11 @@ public function testGalleryFavorites()
|
116 | 116 | $this->assertSame($expectedValue, $api->galleryFavorites());
|
117 | 117 | }
|
118 | 118 |
|
119 |
| - /** |
120 |
| - * @expectedException \Imgur\Exception\InvalidArgumentException |
121 |
| - * @expectedExceptionMessage is wrong. Possible values are |
122 |
| - */ |
123 | 119 | public function testGalleryFavoritesWrongValues()
|
124 | 120 | {
|
| 121 | + $this->expectException(InvalidArgumentException::class); |
| 122 | + $this->expectExceptionMessage('is wrong. Possible values are'); |
| 123 | + |
125 | 124 | $this->getApiMock()->galleryFavorites('me', 0, 'bad sort');
|
126 | 125 | }
|
127 | 126 |
|
@@ -409,12 +408,11 @@ public function testComments()
|
409 | 408 | $this->assertSame($expectedValue, $api->comments());
|
410 | 409 | }
|
411 | 410 |
|
412 |
| - /** |
413 |
| - * @expectedException \Imgur\Exception\InvalidArgumentException |
414 |
| - * @expectedExceptionMessage is wrong. Possible values are |
415 |
| - */ |
416 | 411 | public function testCommentsWrongValues()
|
417 | 412 | {
|
| 413 | + $this->expectException(InvalidArgumentException::class); |
| 414 | + $this->expectExceptionMessage('is wrong. Possible values are'); |
| 415 | + |
418 | 416 | $this->getApiMock()->comments('me', 0, 'bad sort');
|
419 | 417 | }
|
420 | 418 |
|
@@ -460,12 +458,11 @@ public function testCommentIds()
|
460 | 458 | $this->assertSame($expectedValue, $api->commentIds());
|
461 | 459 | }
|
462 | 460 |
|
463 |
| - /** |
464 |
| - * @expectedException \Imgur\Exception\InvalidArgumentException |
465 |
| - * @expectedExceptionMessage is wrong. Possible values are |
466 |
| - */ |
467 | 461 | public function testCommentIdsWrongValues()
|
468 | 462 | {
|
| 463 | + $this->expectException(InvalidArgumentException::class); |
| 464 | + $this->expectExceptionMessage('is wrong. Possible values are'); |
| 465 | + |
469 | 466 | $this->getApiMock()->commentIds('me', 0, 'bad sort');
|
470 | 467 | }
|
471 | 468 |
|
|
0 commit comments