-
-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
15 additions
and
9 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
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
use Github\HttpClient\Message\ResponseMediator; | ||
use GuzzleHttp\Psr7\Response; | ||
use GuzzleHttp\Psr7\Utils; | ||
|
||
/** | ||
* @author Tobias Nyholm <[email protected]> | ||
|
@@ -16,7 +17,7 @@ public function testGetContent() | |
$response = new Response( | ||
200, | ||
['Content-Type' => 'application/json'], | ||
\GuzzleHttp\Psr7\stream_for(json_encode($body)) | ||
Utils::streamFor(json_encode($body)) | ||
); | ||
|
||
$this->assertEquals($body, ResponseMediator::getContent($response)); | ||
|
@@ -31,7 +32,7 @@ public function testGetContentNotJson() | |
$response = new Response( | ||
200, | ||
[], | ||
\GuzzleHttp\Psr7\stream_for($body) | ||
Utils::streamFor($body) | ||
); | ||
|
||
$this->assertEquals($body, ResponseMediator::getContent($response)); | ||
|
@@ -46,7 +47,7 @@ public function testGetContentInvalidJson() | |
$response = new Response( | ||
200, | ||
['Content-Type' => 'application/json'], | ||
\GuzzleHttp\Psr7\stream_for($body) | ||
Utils::streamFor($body) | ||
); | ||
|
||
$this->assertEquals($body, ResponseMediator::getContent($response)); | ||
|
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
namespace Github\Tests\Mock; | ||
|
||
use GuzzleHttp\Psr7\Response; | ||
use GuzzleHttp\Psr7\Utils; | ||
|
||
/** | ||
* @author Tobias Nyholm <[email protected]> | ||
|
@@ -18,10 +19,10 @@ public function __construct($loopCount, array $content = []) | |
$this->loopCount = $loopCount; | ||
$this->content = $content; | ||
|
||
parent::__construct(200, ['Content-Type' => 'application/json'], \GuzzleHttp\Psr7\stream_for(json_encode($content))); | ||
parent::__construct(200, ['Content-Type' => 'application/json'], Utils::streamFor(json_encode($content))); | ||
} | ||
|
||
public function getHeader($header) | ||
public function getHeader($header): array | ||
{ | ||
if ($header === 'Link') { | ||
if ($this->loopCount > 1) { | ||
|
@@ -38,7 +39,7 @@ public function getHeader($header) | |
return parent::getHeader($header); | ||
} | ||
|
||
public function hasHeader($header) | ||
public function hasHeader($header): bool | ||
{ | ||
if ($header === 'Link') { | ||
return true; | ||
|