-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from ThePay/hotfix-4213-header-case-sensitivity
Hotfix 4213 header case sensitivity
- Loading branch information
Showing
4 changed files
with
60 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace ThePay\ApiClient\Tests\Http; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use ThePay\ApiClient\Http\HttpResponse; | ||
|
||
/** | ||
* @covers \ThePay\ApiClient\Http\HttpResponse | ||
*/ | ||
final class HttpResponseTest extends TestCase | ||
{ | ||
/** | ||
* @dataProvider dataProviderGetHeader | ||
* | ||
* @param string|null $expectedValue | ||
* @param non-empty-string $headerKey | ||
* @param array<string, string>|null $headers | ||
* | ||
* @return void | ||
*/ | ||
public function testGetHeader($expectedValue, $headerKey, array $headers = null) | ||
{ | ||
$response = new HttpResponse(null, null, '', $headers); | ||
self::assertSame($expectedValue, $response->getHeader($headerKey)); | ||
} | ||
|
||
/** | ||
* @return non-empty-array<array{string|null, non-empty-string, array<string, string>|null}> | ||
*/ | ||
public function dataProviderGetHeader() | ||
{ | ||
return array( | ||
array(null, 'no-headers', null), | ||
array(null, 'empty-headers', array()), | ||
array(null, 'key-not-found', array('another-key' => 'another-value')), | ||
array('value-for-lower-key', 'lower-key', array('Lower-Key' => 'value-for-lower-key')), | ||
array('value-for-upper-key', 'UPPER-KEY', array('Upper-Key' => 'value-for-upper-key')), | ||
array('value-for-same-key', 'same-key', array('same-key' => 'value-for-same-key')), | ||
); | ||
} | ||
} |