Skip to content

Commit

Permalink
Merge pull request phpmyadmin#19055 from kamil-tekiela/curl_close
Browse files Browse the repository at this point in the history
Remove curl_close from TestBase
  • Loading branch information
MauricioFauth authored Mar 15, 2024
2 parents 4d691ea + 4c39978 commit 3ed4124
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
10 changes: 5 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15140,6 +15140,11 @@ parameters:
count: 2
path: tests/end-to-end/TestBase.php

-
message: "#^Only booleans are allowed in a negated boolean, int given\\.$#"
count: 2
path: tests/end-to-end/TestBase.php

-
message: "#^Only booleans are allowed in a negated boolean, int\\|false given\\.$#"
count: 1
Expand All @@ -15155,11 +15160,6 @@ parameters:
count: 1
path: tests/end-to-end/TestBase.php

-
message: "#^Only booleans are allowed in an if condition, int given\\.$#"
count: 2
path: tests/end-to-end/TestBase.php

-
message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#"
count: 2
Expand Down
13 changes: 6 additions & 7 deletions tests/end-to-end/TestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
use Throwable;

use function bin2hex;
use function curl_close;
use function curl_errno;
use function curl_error;
use function curl_exec;
Expand Down Expand Up @@ -1139,11 +1138,11 @@ private function markTestAs(string $status, string $message): void
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error: ' . curl_error($ch) . "\n";
if (! curl_errno($ch)) {
return;
}

curl_close($ch);
echo 'Error: ' . curl_error($ch) . "\n";
}

private function getErrorVideoUrl(): void
Expand Down Expand Up @@ -1173,11 +1172,11 @@ private function getErrorVideoUrl(): void
echo 'Test failed, get more information here: ' . $proj->automation_session->public_url . "\n";
}

if (curl_errno($ch)) {
echo 'Error: ' . curl_error($ch) . "\n";
if (! curl_errno($ch)) {
return;
}

curl_close($ch);
echo 'Error: ' . curl_error($ch) . "\n";
}

/**
Expand Down

0 comments on commit 3ed4124

Please sign in to comment.