Skip to content

Commit

Permalink
Merge pull request #8763 from kenjis/refactor-CURLRequest-tests
Browse files Browse the repository at this point in the history
test: refactor CURLRequset tests
  • Loading branch information
kenjis authored Apr 12, 2024
2 parents fb9607c + c6c4f81 commit 774cbd5
Show file tree
Hide file tree
Showing 5 changed files with 178 additions and 1,218 deletions.
50 changes: 0 additions & 50 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -5331,11 +5331,6 @@
'count' => 10,
'path' => __DIR__ . '/system/HTTP/CURLRequest.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/HTTP/CURLRequest.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:applyBody\\(\\) has parameter \\$curlOptions with no value type specified in iterable type array\\.$#',
'count' => 1,
Expand Down Expand Up @@ -12866,36 +12861,6 @@
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CLIRequestTest.php',
];
$ignoreErrors[] = [
'message' => '#^Assigning \'10\' directly on offset \'HTTP_CONTENT_LENGTH\' of \\$_SERVER is discouraged\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
];
$ignoreErrors[] = [
'message' => '#^Assigning \'en\\-US\' directly on offset \'HTTP_ACCEPT_LANGUAGE\' of \\$_SERVER is discouraged\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
];
$ignoreErrors[] = [
'message' => '#^Assigning \'gzip, deflate, br\' directly on offset \'HTTP_ACCEPT_ENCODING\' of \\$_SERVER is discouraged\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
];
$ignoreErrors[] = [
'message' => '#^Assigning \'site1\\.com\' directly on offset \'HTTP_HOST\' of \\$_SERVER is discouraged\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequestDoNotShareOptionsTest\\:\\:getRequest\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
];
$ignoreErrors[] = [
'message' => '#^Access to an undefined property CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:\\$curl_options\\.$#',
'count' => 39,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
];
$ignoreErrors[] = [
'message' => '#^Assigning \'10\' directly on offset \'HTTP_CONTENT_LENGTH\' of \\$_SERVER is discouraged\\.$#',
'count' => 1,
Expand All @@ -12916,21 +12881,6 @@
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
];
$ignoreErrors[] = [
'message' => '#^Call to an undefined method CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:setOutput\\(\\)\\.$#',
'count' => 4,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequestTest\\:\\:getRequest\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequestTest\\:\\:getRequest\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\HTTP\\\\ContentSecurityPolicyTest\\:\\:work\\(\\) has no return type specified\\.$#',
'count' => 1,
Expand Down
2 changes: 2 additions & 0 deletions system/HTTP/CURLRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ class CURLRequest extends OutgoingRequest
* - baseURI
* - timeout
* - any other request options to use as defaults.
*
* @param array<string, mixed> $options
*/
public function __construct(App $config, URI $uri, ?ResponseInterface $response = null, array $options = [])
{
Expand Down
Loading

0 comments on commit 774cbd5

Please sign in to comment.