Skip to content

Commit 3133750

Browse files
committed
test
1 parent 013586e commit 3133750

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

ext/standard/tests/mail/bug72964.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ if ($res !== true) {
3333
}
3434

3535
$mail = searchEmailByToAddress($to);
36+
var_dump($mail);
3637

3738
if (mailCheckResponse($res, $from, $to, $subject, $message)) {
3839
echo "Received the email.\n";

ext/standard/tests/mail/bug80751.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ if (mailCheckResponse($res, $from, $to, $subject, $message)) {
5757
echo "Return-Path is as expected.\n";
5858
}
5959

60-
if (getNameAndAddressLine($res['To'][0]) === $toLine) {
60+
if (makeNameAndAddressLine($res['To'][0]) === $toLine) {
6161
echo "To header is as expected.\n";
6262
}
6363

64-
if (getNameAndAddressLine($res['From']) === $fromLine) {
64+
if (makeNameAndAddressLine($res['From']) === $fromLine) {
6565
echo "From header is as expected.\n";
6666
}
6767

68-
if (getNameAndAddressLine($res['Cc'][0]) === $ccLine) {
68+
if (makeNameAndAddressLine($res['Cc'][0]) === $ccLine) {
6969
echo "Cc header is as expected.";
7070
}
7171

ext/standard/tests/mail/mailpit_utils.inc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function searchEmailByToAddress(string $to): ?array
1818
function getHeaders($res): array
1919
{
2020
$headerRes = file_get_contents("http://localhost:8025/api/v1/message/{$res['ID']}/headers");
21-
return json_decode($res, true);
21+
return json_decode($headerRes, true);
2222
}
2323

2424
function mailCheckResponse($res, string $from, string $to, string $subject, string $message): bool
@@ -27,7 +27,7 @@ function mailCheckResponse($res, string $from, string $to, string $subject, stri
2727
($res['From']['Address'] ?? null) === $from &&
2828
($res['To'][0]['Address'] ?? null) === $to &&
2929
($res['Subject'] ?? null) === $subject &&
30-
trim($res['Text'] ?? '') === $message;
30+
trim($res['Text'] ?? '') === trim($message);
3131
}
3232

3333
function getCcAddresses($res): array
@@ -51,11 +51,9 @@ function deleteEmail($res)
5151

5252
if ($id) {
5353
$query = urlencode("message-id:{$id}");
54-
file_get_contents("http://localhost:8025/api/v1/search?query=$query", stream_context_create([
55-
[
56-
'http' => [
57-
'method' => 'DELETE',
58-
],
54+
file_get_contents("http://localhost:8025/api/v1/search?query={$query}", stream_context_create([
55+
'http' => [
56+
'method' => 'DELETE',
5957
],
6058
]));
6159
}

0 commit comments

Comments
 (0)