-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Method annotation is not enforcing return type argument (#2497)
* Remove annotation method in order to enforce return type * Wrote tests about BadResponseException * Added docblocks for BadResponseException * update baseline and fix codestyle
- Loading branch information
Showing
3 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace GuzzleHttp\Tests\Exception; | ||
|
||
use GuzzleHttp\Exception\BadResponseException; | ||
use GuzzleHttp\Psr7\Request; | ||
use GuzzleHttp\Psr7\Response; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class BadResponseExceptionTest extends TestCase | ||
{ | ||
public function testHasNoResponse() | ||
{ | ||
$req = new Request('GET', '/'); | ||
$prev = new \Exception(); | ||
$response = new Response(); | ||
$e = new BadResponseException('foo', $req, $response, $prev); | ||
self::assertSame($req, $e->getRequest()); | ||
self::assertSame($response, $e->getResponse()); | ||
self::assertTrue($e->hasResponse()); | ||
self::assertSame('foo', $e->getMessage()); | ||
self::assertSame($prev, $e->getPrevious()); | ||
} | ||
} |