Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions tests/system/HTTP/CURLRequestExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testFailureResetsSetterOptions(string $failure, string $setter):
$app = new App();
$request = $failure === 'transport'
? $this->failingRequest()
: new MockCURLRequest($app, new URI(), new Response($app));
: new MockCURLRequest($app, new URI(), new Response());

$request->setHeader('Authorization', 'Bearer secret');

Expand Down Expand Up @@ -115,7 +115,7 @@ public function testRequestRestoresBaseURIAndDelay(bool $fail, string $defaults)
$app = new App();
$request = $fail
? $this->failingRequest($options, $uri)
: new MockCURLRequest($app, $uri, new Response($app), $options);
: new MockCURLRequest($app, $uri, new Response(), $options);

try {
$request->get('reports', [
Expand All @@ -138,8 +138,7 @@ public function testRequestRestoresBaseURIAndDelay(bool $fail, string $defaults)

$request->get('', ['baseURI' => 'https://other.example/']);

$expectedURL = $defaults === 'none' ? 'https://other.example/' : 'https://other.example/?default=value';
$this->assertSame($expectedURL, $request->curl_options[CURLOPT_URL]);
$this->assertSame('https://other.example/', $request->curl_options[CURLOPT_URL]);
$this->assertSame($expectedURI, (string) $request->getBaseURI());
}

Expand All @@ -163,7 +162,7 @@ public function testSharingPreservesBaseURIAndDelay(bool $fail): void
$app = new App();
$request = $fail
? $this->failingRequest()
: new MockCURLRequest($app, new URI(), new Response($app));
: new MockCURLRequest($app, new URI(), new Response());
$baseURI = 'https://alice@private.example:8443/v2/?api_key=secret';

try {
Expand Down Expand Up @@ -229,7 +228,7 @@ public function testOptionValidationFailureResetsRequestOptions(): void
$this->configureSharing(false);

$app = new App();
$request = new MockCURLRequest($app, new URI(), new Response($app));
$request = new MockCURLRequest($app, new URI(), new Response());

try {
$request->post('https://private.example/upload', [
Expand Down Expand Up @@ -284,7 +283,7 @@ private function failingRequest(array $options = [], ?URI $uri = null): MockCURL
{
$app = new App();

return new class ($app, $uri ?? new URI(), new Response($app), $options) extends MockCURLRequest {
return new class ($app, $uri ?? new URI(), new Response(), $options) extends MockCURLRequest {
private bool $failNextRequest = true;

protected function sendRequest(array $curlOptions = []): string
Expand Down
7 changes: 1 addition & 6 deletions utils/phpstan-baseline/arguments.count.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 11 errors
# total 6 errors

parameters:
ignoreErrors:
Expand All @@ -12,11 +12,6 @@ parameters:
count: 2
path: ../../tests/system/Debug/ToolbarTest.php

-
message: '#^Class CodeIgniter\\HTTP\\Response constructor invoked with 1 parameter, 0 required\.$#'
count: 5
path: ../../tests/system/HTTP/CURLRequestExceptionTest.php

-
message: '#^Class CodeIgniter\\HTTP\\Response constructor invoked with 1 parameter, 0 required\.$#'
count: 1
Expand Down
2 changes: 1 addition & 1 deletion utils/phpstan-baseline/loader.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 37 errors
# total 32 errors

includes:
- arguments.count.neon
Expand Down
Loading