Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4eedcb4
ext/bz2: applied fixers to improve test robustness
NickSdot Aug 1, 2026
78350f1
ext/calendar: applied fixers to improve test robustness
NickSdot Aug 1, 2026
bf7c67d
ext/exif: applied fixers to improve test robustness
NickSdot Aug 1, 2026
fc9a27f
ext/fileinfo: applied fixers to improve test robustness
NickSdot Aug 1, 2026
de99a06
ext/filter: applied fixers to improve test robustness
NickSdot Aug 1, 2026
72456d5
ext/ftp: applied fixers to improve test robustness
NickSdot Aug 1, 2026
5f10394
ext/hash: applied fixers to improve test robustness
NickSdot Aug 1, 2026
e185b2a
ext/iconv: applied fixers to improve test robustness
NickSdot Aug 1, 2026
525068f
ext/ldap: applied fixers to improve test robustness
NickSdot Aug 1, 2026
5f7cebc
ext/pcre: applied fixers to improve test robustness
NickSdot Aug 1, 2026
7b61dae
ext/posix: applied fixers to improve test robustness
NickSdot Aug 1, 2026
86c8be2
ext/readline: applied fixers to improve test robustness
NickSdot Aug 1, 2026
d20188f
ext/shmop: applied fixers to improve test robustness
NickSdot Aug 1, 2026
1d4b05a
ext/snmp: applied fixers to improve test robustness
NickSdot Aug 1, 2026
675a76f
ext/sodium: applied fixers to improve test robustness
NickSdot Aug 1, 2026
57f6060
ext/sqlite3: applied fixers to improve test robustness
NickSdot Aug 1, 2026
32bdb75
ext/sysvmsg: applied fixers to improve test robustness
NickSdot Aug 1, 2026
a78699d
ext/sysvsem: applied fixers to improve test robustness
NickSdot Aug 1, 2026
8542279
ext/sysvshm: applied fixers to improve test robustness
NickSdot Aug 1, 2026
2d8fe81
ext/tidy: applied fixers to improve test robustness
NickSdot Aug 1, 2026
bbbe91c
ext/tokenizer: applied fixers to improve test robustness
NickSdot Aug 1, 2026
9ad133c
ext/zend_test: applied fixers to improve test robustness
NickSdot Aug 1, 2026
b3ffaeb
ext/zlib: applied fixers to improve test robustness
NickSdot Aug 1, 2026
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
20 changes: 10 additions & 10 deletions ext/bz2/tests/001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ bz2
try {
var_dump(bzopen("", "r"));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
var_dump(bzopen("", "w"));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
var_dump(bzopen("no_such_file", ""));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
var_dump(bzopen("no_such_file", "x"));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
var_dump(bzopen("no_such_file", "rw"));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

var_dump(bzopen("no_such_file", "r"));
Expand All @@ -42,11 +42,11 @@ var_dump(bzopen($fp, "r"));

?>
--EXPECTF--
bzopen(): Argument #1 ($file) must not be empty
bzopen(): Argument #1 ($file) must not be empty
bzopen(): Argument #2 ($mode) must be either "r" or "w"
bzopen(): Argument #2 ($mode) must be either "r" or "w"
bzopen(): Argument #2 ($mode) must be either "r" or "w"
ValueError: bzopen(): Argument #1 ($file) must not be empty
ValueError: bzopen(): Argument #1 ($file) must not be empty
ValueError: bzopen(): Argument #2 ($mode) must be either "r" or "w"
ValueError: bzopen(): Argument #2 ($mode) must be either "r" or "w"
ValueError: bzopen(): Argument #2 ($mode) must be either "r" or "w"

Warning: bzopen(): Failed to open stream: No such file or directory in %s on line %d
bool(false)
Expand Down
8 changes: 4 additions & 4 deletions ext/bz2/tests/002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ $fp = fopen("bz_open_002.txt", "br");
try {
var_dump(bzopen($fp, "r"));
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

$fp = fopen("bz_open_002.txt", "br");
try {
var_dump(bzopen($fp, "w"));
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

$fp = fopen("bz_open_002.txt", "r");
Expand Down Expand Up @@ -91,10 +91,10 @@ resource(%d) of type (stream)
resource(%d) of type (stream)

Warning: fopen(): Failed to open stream: `br' is not a valid mode for fopen in %s on line %d
bzopen(): Argument #1 ($file) must be of type string or file-resource, false given
TypeError: bzopen(): Argument #1 ($file) must be of type string or file-resource, false given

Warning: fopen(): Failed to open stream: `br' is not a valid mode for fopen in %s on line %d
bzopen(): Argument #1 ($file) must be of type string or file-resource, false given
TypeError: bzopen(): Argument #1 ($file) must be of type string or file-resource, false given

Warning: bzopen(): cannot write to a stream opened in read only mode in %s on line %d
bool(false)
Expand Down
4 changes: 2 additions & 2 deletions ext/bz2/tests/003-mb.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var_dump(bzread($fd, 0));
try {
var_dump(bzread($fd, -10));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

var_dump(bzread($fd, 1));
Expand All @@ -21,7 +21,7 @@ var_dump(bzread($fd, 100000));
?>
--EXPECT--
string(0) ""
bzread(): Argument #2 ($length) must be greater than or equal to 0
ValueError: bzread(): Argument #2 ($length) must be greater than or equal to 0
string(1) "R"
string(2) "is"
string(251) "ing up from the heart of the desert
Expand Down
4 changes: 2 additions & 2 deletions ext/bz2/tests/003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var_dump(bzread($fd, 0));
try {
var_dump(bzread($fd, -10));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

var_dump(bzread($fd, 1));
Expand All @@ -21,7 +21,7 @@ var_dump(bzread($fd, 100000));
?>
--EXPECT--
string(0) ""
bzread(): Argument #2 ($length) must be greater than or equal to 0
ValueError: bzread(): Argument #2 ($length) must be greater than or equal to 0
string(1) "R"
string(2) "is"
string(251) "ing up from the heart of the desert
Expand Down
16 changes: 8 additions & 8 deletions ext/bz2/tests/004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ bzclose($fd2);
try {
var_dump(bzread($fd2));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerror($fd2));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerrstr($fd2));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerrno($fd2));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

echo "Done\n";
Expand Down Expand Up @@ -112,8 +112,8 @@ array(2) {
}
string(10) "DATA_ERROR"
int(-4)
bzread(): Argument #1 ($bz) must be an open stream resource
bzerror(): Argument #1 ($bz) must be an open stream resource
bzerrstr(): Argument #1 ($bz) must be an open stream resource
bzerrno(): Argument #1 ($bz) must be an open stream resource
TypeError: bzread(): Argument #1 ($bz) must be an open stream resource
TypeError: bzerror(): Argument #1 ($bz) must be an open stream resource
TypeError: bzerrstr(): Argument #1 ($bz) must be an open stream resource
TypeError: bzerrno(): Argument #1 ($bz) must be an open stream resource
Done
12 changes: 6 additions & 6 deletions ext/bz2/tests/bzerr_functions_on_invalid_stream.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ $f = fopen(__FILE__, 'r');
try {
var_dump(bzerrno($f));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerrstr($f));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bzerror($f));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
bzerrno(): Argument #1 ($bz) must be a bz2 stream
bzerrstr(): Argument #1 ($bz) must be a bz2 stream
bzerror(): Argument #1 ($bz) must be a bz2 stream
TypeError: bzerrno(): Argument #1 ($bz) must be a bz2 stream
TypeError: bzerrstr(): Argument #1 ($bz) must be a bz2 stream
TypeError: bzerror(): Argument #1 ($bz) must be a bz2 stream
8 changes: 4 additions & 4 deletions ext/bz2/tests/bzopen_string_filename_with_null_bytes.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ bz2
try {
bzopen("file\0", "w");
} catch (TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
bzopen("file\0", "r");
} catch (TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
bzopen(): Argument #1 ($file) must not contain null bytes
bzopen(): Argument #1 ($file) must not contain null bytes
TypeError: bzopen(): Argument #1 ($file) must not contain null bytes
TypeError: bzopen(): Argument #1 ($file) must not contain null bytes
4 changes: 2 additions & 2 deletions ext/calendar/tests/bug80185.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ var_dump(jdtounix((int)(PHP_INT_MAX / 86400 + 2440588)));
try {
var_dump(jdtounix((int)(PHP_INT_MAX / 86400 + 2440589)));
} catch (ValueError $ex) {
echo $ex->getMessage(), PHP_EOL;
echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
int(2170713600)
int(9223372036854720000)
jday must be between 2440588 and 106751993607888
ValueError: jday must be between 2440588 and 106751993607888
Comment thread
Girgias marked this conversation as resolved.
8 changes: 4 additions & 4 deletions ext/calendar/tests/cal_days_in_month_error1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ calendar
try {
cal_days_in_month(-1, 4, 2017);
} catch (ValueError $ex) {
echo "{$ex->getMessage()}\n";
echo $ex::class, ': ', $ex->getMessage(), "\n";
}
try{
cal_days_in_month(CAL_GREGORIAN,20, 2009);
} catch (ValueError $ex) {
echo "{$ex->getMessage()}\n";
echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
cal_days_in_month(): Argument #1 ($calendar) must be a valid calendar ID
Invalid date
ValueError: cal_days_in_month(): Argument #1 ($calendar) must be a valid calendar ID
ValueError: Invalid date
4 changes: 2 additions & 2 deletions ext/calendar/tests/cal_from_jd_error1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ calendar
try {
cal_from_jd(1748326, -1);
} catch (ValueError $ex) {
echo "{$ex->getMessage()}\n";
echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
cal_from_jd(): Argument #2 ($calendar) must be a valid calendar ID
ValueError: cal_from_jd(): Argument #2 ($calendar) must be a valid calendar ID
4 changes: 2 additions & 2 deletions ext/calendar/tests/cal_info.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ calendar
try {
cal_info(99999);
} catch (ValueError $ex) {
echo "{$ex->getMessage()}\n";
echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
Expand Down Expand Up @@ -216,4 +216,4 @@ Array
[calname] => Julian
[calsymbol] => CAL_JULIAN
)
cal_info(): Argument #1 ($calendar) must be a valid calendar ID
ValueError: cal_info(): Argument #1 ($calendar) must be a valid calendar ID
4 changes: 2 additions & 2 deletions ext/calendar/tests/cal_to_jd_error1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ calendar
try {
cal_to_jd(-1, 8, 26, 74);
} catch (ValueError $ex) {
echo "{$ex->getMessage()}\n";
echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
cal_to_jd(): Argument #1 ($calendar) must be a valid calendar ID
ValueError: cal_to_jd(): Argument #1 ($calendar) must be a valid calendar ID
16 changes: 8 additions & 8 deletions ext/calendar/tests/easter_date_64bit.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ echo date("Y-m-d", easter_date(2047))."\n";
try {
easter_date(1492);
} catch (ValueError $ex) {
echo "{$ex->getMessage()}\n";
echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
2000-04-23
2001-04-15
2002-03-31
2045-04-09
2046-03-25
2047-04-14
easter_date(): Argument #1 ($year) must be a year after 1970 (inclusive)
2000-04-23
2001-04-15
2002-03-31
2045-04-09
2046-03-25
2047-04-14
ValueError: easter_date(): Argument #1 ($year) must be a year after 1970 (inclusive)
4 changes: 2 additions & 2 deletions ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ putenv('TZ=UTC');
try {
easter_date(293274701009);
} catch (ValueError $ex) {
echo "{$ex->getMessage()}\n";
echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
easter_date(): Argument #1 ($year) must be a year before 2.000.000.000 (inclusive)
ValueError: easter_date(): Argument #1 ($year) must be a year before 2.000.000.000 (inclusive)
12 changes: 6 additions & 6 deletions ext/calendar/tests/gh16228.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ calendar
try {
easter_days(PHP_INT_MAX, 0);
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
easter_days(-1, 0);
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
easter_date(PHP_INT_MAX, 0);
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
easter_days(): Argument #1 ($year) must be between 1 and %d
easter_days(): Argument #1 ($year) must be between 1 and %d
easter_date(): Argument #1 ($year) must be between 1 and %d
ValueError: easter_days(): Argument #1 ($year) must be between 1 and %d
ValueError: easter_days(): Argument #1 ($year) must be between 1 and %d
ValueError: easter_date(): Argument #1 ($year) must be between 1 and %d
8 changes: 4 additions & 4 deletions ext/calendar/tests/gh16231.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ calendar
try {
jdtounix(PHP_INT_MIN);
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
jdtounix(240587);
} catch (\ValueError $e) {
echo $e->getMessage();
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
jday must be between 2440588 and %d
jday must be between 2440588 and %d
ValueError: jday must be between 2440588 and %d
ValueError: jday must be between 2440588 and %d
Comment thread
Girgias marked this conversation as resolved.
5 changes: 2 additions & 3 deletions ext/calendar/tests/gh16234_2_64.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ if (PHP_INT_SIZE == 4) {
try {
jewishtojd(10, 6, PHP_INT_MIN);
} catch (\ValueError $e) {
echo $e->getMessage(), PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
jewishtojd(): Argument #3 ($year) must be between %i and %d

ValueError: jewishtojd(): Argument #3 ($year) must be between %i and %d
Loading
Loading