Skip to content

Commit 07bbc54

Browse files
committed
Fix file collisions in phar tests
1 parent 852e353 commit 07bbc54

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

ext/phar/tests/fgc_edgecases.phpt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $pname = 'phar://' . $fname;
1717
file_get_contents(array());
1818
chdir(__DIR__);
1919
file_put_contents($fname, "blah\n");
20-
file_put_contents("foob", "test\n");
20+
file_put_contents("fgc_edgecases.txt", "test\n");
2121
echo file_get_contents($fname);
2222
unlink($fname);
2323
mkdir($pname . '/oops');
@@ -26,9 +26,9 @@ file_put_contents($pname . '/foo/hi', '<?php
2626
echo file_get_contents("foo/" . basename(__FILE__));
2727
$context = stream_context_create();
2828
file_get_contents("./hi", 0, $context, 0, -1);
29-
echo file_get_contents("foob");
29+
echo file_get_contents("fgc_edgecases.txt");
3030
set_include_path("' . addslashes(__DIR__) . '");
31-
echo file_get_contents("foob", true);
31+
echo file_get_contents("fgc_edgecases.txt", true);
3232
echo file_get_contents("./hi", 0, $context);
3333
echo file_get_contents("../oops");
3434
echo file_get_contents("./hi", 0, $context, 50000);
@@ -44,17 +44,17 @@ include $pname . '/foo/hi';
4444
--CLEAN--
4545
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
4646
<?php rmdir(__DIR__ . '/poo'); ?>
47-
<?php unlink(__DIR__ . '/foob'); ?>
47+
<?php unlink(__DIR__ . '/fgc_edgecases.txt'); ?>
4848
--EXPECTF--
4949
Warning: file_get_contents() expects parameter 1 to be a valid path, array given in %sfgc_edgecases.php on line %d
5050
blah
5151
<?php
5252
echo file_get_contents("foo/" . basename(__FILE__));
5353
$context = stream_context_create();
5454
file_get_contents("./hi", 0, $context, 0, -1);
55-
echo file_get_contents("foob");
55+
echo file_get_contents("fgc_edgecases.txt");
5656
set_include_path("%stests");
57-
echo file_get_contents("foob", true);
57+
echo file_get_contents("fgc_edgecases.txt", true);
5858
echo file_get_contents("./hi", 0, $context);
5959
echo file_get_contents("../oops");
6060
echo file_get_contents("./hi", 0, $context, 50000);
@@ -69,9 +69,9 @@ test
6969
echo file_get_contents("foo/" . basename(__FILE__));
7070
$context = stream_context_create();
7171
file_get_contents("./hi", 0, $context, 0, -1);
72-
echo file_get_contents("foob");
72+
echo file_get_contents("fgc_edgecases.txt");
7373
set_include_path("%stests");
74-
echo file_get_contents("foob", true);
74+
echo file_get_contents("fgc_edgecases.txt", true);
7575
echo file_get_contents("./hi", 0, $context);
7676
echo file_get_contents("../oops");
7777
echo file_get_contents("./hi", 0, $context, 50000);
@@ -86,9 +86,9 @@ Warning: file_get_contents(): Failed to seek to position 50000 in the stream in
8686
echo file_get_contents("foo/" . basename(__FILE__));
8787
$context = stream_context_create();
8888
file_get_contents("./hi", 0, $context, 0, -1);
89-
echo file_get_contents("foob");
89+
echo file_get_contents("fgc_edgecases.txt");
9090
set_include_path("%stests");
91-
echo file_get_contents("foob", true);
91+
echo file_get_contents("fgc_edgecases.txt", true);
9292
echo file_get_contents("./hi", 0, $context);
9393
echo file_get_contents("../oops");
9494
echo file_get_contents("./hi", 0, $context, 50000);

ext/phar/tests/fopen_edgecases2.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ $pname = 'phar://' . $fname;
1313
fopen(array(), 'r');
1414
chdir(__DIR__);
1515
file_put_contents($fname, "blah\n");
16-
file_put_contents("foob", "test\n");
16+
file_put_contents("fopen_edgecases2.txt", "test\n");
1717
$a = fopen($fname, 'rb');
1818
echo fread($a, 1000);
1919
fclose($a);
2020
unlink($fname);
2121
mkdir($pname . '/oops');
2222
file_put_contents($pname . '/foo/hi', '<?php
2323
$context = stream_context_create();
24-
$a = fopen("foob", "rb", false, $context);
24+
$a = fopen("fopen_edgecases2.txt", "rb", false, $context);
2525
echo fread($a, 1000);
2626
fclose($a);
2727
fopen("../oops", "r");
@@ -33,7 +33,7 @@ include $pname . '/foo/hi';
3333
--CLEAN--
3434
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
3535
<?php rmdir(__DIR__ . '/poo'); ?>
36-
<?php unlink(__DIR__ . '/foob'); ?>
36+
<?php unlink(__DIR__ . '/fopen_edgecases2.txt'); ?>
3737
--EXPECTF--
3838
Warning: fopen() expects parameter 1 to be a valid path, array given in %sfopen_edgecases2.php on line %d
3939
blah

ext/phar/tests/readfile_edgecases.phpt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ $pname = 'phar://' . $fname;
1313
readfile(array());
1414
chdir(__DIR__);
1515
file_put_contents($fname, "blah\n");
16-
file_put_contents("foob", "test\n");
16+
file_put_contents("readfile_edgecases.txt", "test\n");
1717
readfile($fname);
1818
unlink($fname);
1919
mkdir($pname . '/oops');
2020
file_put_contents($pname . '/foo/hi', '<?php
2121
readfile("foo/" . basename(__FILE__));
2222
$context = stream_context_create();
23-
readfile("foob");
23+
readfile("readfile_edgecases.txt");
2424
set_include_path("' . addslashes(__DIR__) . '");
25-
readfile("foob", true);
25+
readfile("readfile_edgecases.txt", true);
2626
readfile("./hi", 0, $context);
2727
readfile("../oops");
2828
?>
@@ -33,16 +33,16 @@ include $pname . '/foo/hi';
3333
--CLEAN--
3434
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
3535
<?php rmdir(__DIR__ . '/poo'); ?>
36-
<?php unlink(__DIR__ . '/foob'); ?>
36+
<?php unlink(__DIR__ . '/readfile_edgecases.txt'); ?>
3737
--EXPECTF--
3838
Warning: readfile() expects parameter 1 to be a valid path, array given in %sreadfile_edgecases.php on line %d
3939
blah
4040
<?php
4141
readfile("foo/" . basename(__FILE__));
4242
$context = stream_context_create();
43-
readfile("foob");
43+
readfile("readfile_edgecases.txt");
4444
set_include_path("%stests");
45-
readfile("foob", true);
45+
readfile("readfile_edgecases.txt", true);
4646
readfile("./hi", 0, $context);
4747
readfile("../oops");
4848
?>
@@ -51,9 +51,9 @@ test
5151
<?php
5252
readfile("foo/" . basename(__FILE__));
5353
$context = stream_context_create();
54-
readfile("foob");
54+
readfile("readfile_edgecases.txt");
5555
set_include_path("%stests");
56-
readfile("foob", true);
56+
readfile("readfile_edgecases.txt", true);
5757
readfile("./hi", 0, $context);
5858
readfile("../oops");
5959
?>

0 commit comments

Comments
 (0)