Skip to content

Replace EXPECTF when possible #5779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion Zend/tests/attributes/004_name_resolution.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace {
dump_attributes((new ReflectionFunction('Foo\foo'))->getAttributes());
}
?>
--EXPECTF--
--EXPECT--
array(5) {
[0]=>
array(2) {
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/attributes/007_self_reflect_attribute.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ foreach ($attributes as $attribute) {
var_dump(get_class($a));
var_dump($a->flags == Attribute::TARGET_ALL);
}
--EXPECTF--
--EXPECT--
string(9) "Attribute"
array(0) {
}
Expand Down
2 changes: 1 addition & 1 deletion ext/calendar/tests/jdtomonthname.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ foreach ($jd_days as $jd_day) {
echo "Done\n";

?>
--EXPECTF--
--EXPECT--
=== 2453396
string(3) "Jan"
string(7) "January"
Expand Down
2 changes: 1 addition & 1 deletion ext/curl/tests/curl_copy_handle_variation4.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ curl_multi_remove_handle($mh, $ch3);
curl_multi_close($mh);
?>
===DONE===
--EXPECTF--
--EXPECT--
bool(true)
АБВ.txt|application/octet-stream|5АБВ.txt|application/octet-stream|5===DONE===
--CLEAN--
Expand Down
2 changes: 1 addition & 1 deletion ext/curl/tests/curl_multi_close_basic001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var_dump($multi_close_result);
var_dump($cmh);
curl_multi_close($cmh);
?>
--EXPECTF--
--EXPECT--
object(CurlMultiHandle)#1 (0) {
}
NULL
Expand Down
2 changes: 1 addition & 1 deletion ext/curl/tests/curl_multi_init_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var_dump($mh);
curl_multi_close($mh);
var_dump($mh);
?>
--EXPECTF--
--EXPECT--
*** Testing curl_multi_init(void); ***
object(CurlMultiHandle)#1 (0) {
}
Expand Down
2 changes: 1 addition & 1 deletion ext/date/tests/bug52062.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var_dump($d->getTimestamp());
$i = new DateInterval('PT100000000000S');
var_dump($i->format('%s'));
?>
--EXPECTF--
--EXPECT--
string(32) "5138-11-16 09:46:40 100000000000"
bool(false)
string(12) "100000000000"
Expand Down
2 changes: 1 addition & 1 deletion ext/dba/tests/dba_handlers.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ foreach ($h as $key => $val) {
<?php
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
--EXPECT--
database handler: flatfile
Test 1
Success: flatfile enabled
Expand Down
2 changes: 1 addition & 1 deletion ext/dba/tests/dba_optimize.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
<?php
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
--EXPECT--
database handler: flatfile
2YY
bool(true)
2 changes: 1 addition & 1 deletion ext/dba/tests/dba_split.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var_dump(dba_key_split("[key1]name1[key2]name2"));
var_dump(dba_key_split("[key1]name1"));

?>
--EXPECTF--
--EXPECT--
array(2) {
[0]=>
string(0) ""
Expand Down
2 changes: 1 addition & 1 deletion ext/dba/tests/dba_sync.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
<?php
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
--EXPECT--
database handler: flatfile
2YY
bool(true)
2 changes: 1 addition & 1 deletion ext/enchant/tests/invalidobj.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if (is_object($broker)) {
}
echo "OK\n";
?>
--EXPECTF--
--EXPECT--
OK
Invalid or uninitialized EnchantBroker object
OK
2 changes: 1 addition & 1 deletion ext/exif/tests/bug77753.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Bug #77753 (Heap-buffer-overflow in php_ifd_get32s)
@var_dump(exif_read_data(__DIR__."/bug77753.tiff"));
?>
DONE
--EXPECTF--
--EXPECT--
bool(false)
DONE
4 changes: 2 additions & 2 deletions ext/exif/tests/bug77988.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Bug #77988 (heap-buffer-overflow on php_jpg_get16)
exif_read_data(__DIR__."/bug77988.jpg", 'COMMENT', FALSE, TRUE);
?>
DONE
--EXPECTF--
DONE
--EXPECT--
DONE
4 changes: 2 additions & 2 deletions ext/exif/tests/bug78222.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Bug #78222 (heap-buffer-overflow on exif_scan_thumbnail)
exif_read_data(__DIR__."/bug78222.jpg", 'THUMBNAIL', FALSE, TRUE);
?>
DONE
--EXPECTF--
DONE
--EXPECT--
DONE
4 changes: 2 additions & 2 deletions ext/exif/tests/bug78256.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Bug #78256 (heap-buffer-overflow on exif_process_user_comment)
@exif_read_data(__DIR__."/bug78256.jpg", 'COMMENT', FALSE, TRUE);
?>
DONE
--EXPECTF--
DONE
--EXPECT--
DONE
2 changes: 1 addition & 1 deletion ext/exif/tests/duplicate_copyright_tag_leak.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ if (!extension_loaded('exif')) {

?>
===DONE===
--EXPECTF--
--EXPECT--
===DONE===
2 changes: 1 addition & 1 deletion ext/ffi/tests/045.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ try {
echo get_class($e) . ": " . $e->getMessage()."\n";
}
?>
--EXPECTF--
--EXPECT--
bool(true)
bool(false)
TypeError: FFI::isNull(): Argument #1 ($ptr) must be of type FFI\CData, null given
Expand Down
2 changes: 1 addition & 1 deletion ext/gd/tests/bug55005.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ trycatch_dump(
fn () => imagepolygon($g, array(200,10, 200,100, 280,100), 2, $fgnd)
);
?>
--EXPECTF--
--EXPECT--
!! [ValueError] imagefilledpolygon(): Argument #3 ($num_points_or_col) must be greater than or equal to 3
!! [ValueError] imagepolygon(): Argument #3 ($num_points_or_col) must be greater than or equal to 3
2 changes: 1 addition & 1 deletion ext/gd/tests/imagepng_nullbyte_injection.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ try {
echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
--EXPECT--
imagepng(): Argument #2 ($to) must not contain null bytes
2 changes: 1 addition & 1 deletion ext/gd/tests/imagexbm_nullbyte_injection.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ try {
echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
--EXPECT--
imagexbm(): Argument #2 ($filename) must be a valid path or null, string given
2 changes: 1 addition & 1 deletion ext/gd/tests/lines.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ if ($p3) {


?>
--EXPECTF--
--EXPECT--
Horizontal: ok
Vertical: ok
Diagonal: ok
Expand Down
2 changes: 1 addition & 1 deletion ext/imap/tests/imap_binary_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $base64 = imap_binary($hex);
var_dump(bin2hex($base64));

?>
--EXPECTF--
--EXPECT--
*** Testing imap_binary() : basic functionality ***
Encode as short string
string(136) "5647687063794270637942686269426c654746746347786c49484e30636d6c755a794230627942695a53426959584e6c49445930494756755932396b0d0a5a57513d0d0a"
Expand Down
2 changes: 1 addition & 1 deletion ext/imap/tests/imap_mutf7_to_utf8.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var_dump(imap_mutf7_to_utf8("t&AOQ-st"));

echo "Done\n";
?>
--EXPECTF--
--EXPECT--
string(0) ""
string(1) "1"
string(5) "täst"
Expand Down
2 changes: 1 addition & 1 deletion ext/imap/tests/imap_utf8_to_mutf7_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var_dump(imap_utf8_to_mutf7("täst"));

echo "Done\n";
?>
--EXPECTF--
--EXPECT--
string(0) ""
string(1) "1"
string(8) "t&AOQ-st"
Expand Down
2 changes: 1 addition & 1 deletion ext/ldap/tests/ldap_explode_dn.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var_dump(ldap_explode_dn("bob,dc=example,dc=com", 1));
echo "Done\n";

?>
--EXPECTF--
--EXPECT--
array(4) {
["count"]=>
int(3)
Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/tests/mb_parse_str.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ foreach ($queries as $query) {
test($query);
}
?>
--EXPECTF--
--EXPECT--
array(2) {
["foo"]=>
string(3) "abc"
Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/tests/mb_parse_str02.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ foreach ($queries as $query) {
test($query);
}
?>
--EXPECTF--
--EXPECT--
array(3) {
["foo"]=>
string(3) "abc"
Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/tests/mb_stripos.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ $r = mb_stripos($euc_jp, "\n");
($r === FALSE) ? print "OK_NEWLINE\n" : print "NG_NEWLINE\n";

?>
--EXPECTF--
--EXPECT--
String len: 43
== POSITIVE OFFSET ==
10
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqli/tests/bug36420.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ try {

echo "Done\n";
?>
--EXPECTF--
--EXPECT--
mysqli_result object is already closed
mysqli_result object is already closed
Done
2 changes: 1 addition & 1 deletion ext/mysqli/tests/bug63398.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ try {

echo "okey";
?>
--EXPECTF--
--EXPECT--
mysqli object is already closed
okey
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ require_once('skipifconnectfailure.inc');

print "done!";
?>
--EXPECTF--
--EXPECT--
Parent class:
bool(false)

Expand Down
4 changes: 2 additions & 2 deletions ext/mysqli/tests/mysqli_connect_attr.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ mysqli_close($link);

printf("done!");
?>
--EXPECTF--
done!
--EXPECT--
done!
2 changes: 1 addition & 1 deletion ext/mysqli/tests/mysqli_enable_reads_from_master.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ if (!function_exists('mysqli_enable_reads_from_master')) {

print "done!";
?>
--EXPECTF--
--EXPECT--
mysqli object is already closed
done!
2 changes: 1 addition & 1 deletion ext/mysqli/tests/mysqli_free_result.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ require_once('skipifconnectfailure.inc');
<?php
require_once("clean_table.inc");
?>
--EXPECTF--
--EXPECT--
a
NULL
b
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqli/tests/mysqli_more_results.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ require_once('skipifconnectfailure.inc');
<?php
require_once("clean_table.inc");
?>
--EXPECTF--
--EXPECT--
[004]
bool(false)
[006]
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqli/tests/mysqli_multi_query.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ require_once('skipifconnectfailure.inc');
<?php
require_once("clean_table.inc");
?>
--EXPECTF--
--EXPECT--
[006] 3
[008] 0
[009] [2014] Commands out of sync; you can't run this command now
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqli/tests/mysqli_next_result.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ require_once('skipifconnectfailure.inc');
<?php
require_once("clean_table.inc");
?>
--EXPECTF--
--EXPECT--
mysqli object is already closed
done!
2 changes: 1 addition & 1 deletion ext/mysqli/tests/mysqli_send_query.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ if (!$TEST_EXPERIMENTAL)
}
print "done!";
?>
--EXPECTF--
--EXPECT--
mysqli object is already closed
done!
2 changes: 1 addition & 1 deletion ext/mysqli/tests/mysqli_stmt_get_result_metadata.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ if (!function_exists('mysqli_stmt_get_result'))
<?php
require_once("clean_table.inc");
?>
--EXPECTF--
--EXPECT--
array(2) {
["id"]=>
int(1)
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqli/tests/mysqli_stmt_param_count.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ require_once('skipifconnectfailure.inc');
<?php
require_once("clean_table.inc");
?>
--EXPECTF--
--EXPECT--
mysqli_stmt object is not fully initialized
mysqli_stmt object is already closed
done!
2 changes: 1 addition & 1 deletion ext/mysqli/tests/mysqli_store_result.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ require_once('skipifconnectfailure.inc');
<?php
require_once("clean_table.inc");
?>
--EXPECTF--
--EXPECT--
mysqli object is already closed
done!
2 changes: 1 addition & 1 deletion ext/mysqli/tests/mysqli_warning_count.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ require_once('skipifconnectfailure.inc');
<?php
require_once("clean_table.inc");
?>
--EXPECTF--
--EXPECT--
mysqli object is already closed
done!
2 changes: 1 addition & 1 deletion ext/oci8/tests/coll_018.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ echo "Done\n";
require __DIR__."/drop_type.inc";

?>
--EXPECTF--
--EXPECT--
Test 2.
bool(true)

Expand Down
4 changes: 2 additions & 2 deletions ext/oci8/tests/existence_aliases.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ var_dump(function_exists('ocicollsize'));
var_dump(function_exists('ocicollmax'));
var_dump(function_exists('ocicolltrim'));
?>
--EXPECTF--
--EXPECT--
bool(true)
bool(true)
bool(true)
bool(true)
Expand Down Expand Up @@ -97,4 +98,3 @@ bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
Loading