Skip to content

Commit 6da9f6e

Browse files
committed
Fix tests
1 parent ae55816 commit 6da9f6e

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

ext/phar/tests/phar_oo_008.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MyCSVFile extends SplFileObject
3333
{
3434
function current(): array|false
3535
{
36-
return parent::fgetcsv(',', '"');
36+
return parent::fgetcsv(',', '"', escape: '');
3737
}
3838
}
3939

@@ -44,14 +44,14 @@ $v = $phar['a.csv'];
4444
echo "===3===\n";
4545
while(!$v->eof())
4646
{
47-
echo $v->key() . "=>" . join('|', $v->fgetcsv()) . "\n";
47+
echo $v->key() . "=>" . join('|', $v->fgetcsv(escape: '')) . "\n";
4848
}
4949

5050
echo "===4===\n";
5151
$v->rewind();
5252
while(!$v->eof())
5353
{
54-
$l = $v->fgetcsv();
54+
$l = $v->fgetcsv(escape: '');
5555
echo $v->key() . "=>" . join('|', $l) . "\n";
5656
}
5757

@@ -66,7 +66,7 @@ class MyCSVFile2 extends SplFileObject
6666
function getCurrentLine(): string
6767
{
6868
echo __METHOD__ . "\n";
69-
return implode('|', parent::fgetcsv(',', '"'));
69+
return implode('|', parent::fgetcsv(',', '"', escape: ''));
7070
}
7171
}
7272

ext/standard/tests/file/bug72330.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ if (setlocale(LC_ALL, "en_US.utf8", "en_AU.utf8", "ko_KR.utf8", "zh_CN.utf8", "d
1111
setlocale(LC_ALL, "en_US.utf8", "en_AU.utf8", "ko_KR.utf8", "zh_CN.utf8", "de_DE.utf8", "es_EC.utf8", "fr_FR.utf8", "ja_JP.utf8", "el_GR.utf8", "nl_NL.utf8");
1212

1313
$utf_1 = chr(0xD1) . chr(0x81); // U+0440;
14-
$utf_2 = chr(0xD8) . chr(0x80); // U+0600
14+
$utf_2 = chr(0xD8) . chr(0x80); // U+0600
1515

1616
$string = '"first #' . $utf_1 . $utf_2 . '";"second"';
1717
$fields = str_getcsv($string, ';', '"', "#");
1818
var_dump($fields);
1919
?>
2020
--EXPECTF--
21-
Deprecated: str_getcsv(): Passing a non-empty string to the $escape parameter is deprecated since 8.4 in %s on line %d
2221
array(2) {
2322
[0]=>
2423
string(11) "first #с؀"

ext/standard/tests/general_functions/004.phpt renamed to ext/standard/tests/file/fgetcsv_tab_delimiter.phpt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
fgetcsv() with tab delimited fields (BUG #8258)
33
--FILE--
44
<?php
5-
chdir(__DIR__);
6-
$fp=fopen("004.data","r");
7-
while($a=fgetcsv($fp,100,"\t")) {
5+
6+
$file = __DIR__ . '/fgetcsv_tab_delimiter.data';
7+
$fp = fopen($file,"r");
8+
while ($a = fgetcsv($fp, 100, "\t", escape: '')) {
89
echo join(",",$a)."\n";
910
}
1011
fclose($fp);

ext/standard/tests/oss_fuzz_57392.phpt renamed to ext/standard/tests/strings/oss_fuzz_57392.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var_dump(str_getcsv(
66
"aaaaaaaaaaaa\0 ",
77
"\0",
88
"\0",
9+
escape: '',
910
));
1011
?>
1112
--EXPECT--

0 commit comments

Comments
 (0)