Skip to content

Commit 98d004c

Browse files
committed
Fix CLEAN sections
1 parent 3021ce6 commit 98d004c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+37
-158
lines changed

ext/phar/tests/bug65414.phpt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ foreach ($bads as $bad) {
2424
}
2525
echo 'done' . PHP_EOL;
2626
?>
27-
--CLEAN--
28-
<?php
29-
unlink(__DIR__ . '/bug65414.phar');
30-
?>
3127
--EXPECT--
3228
.phar/injected-1.txt:Cannot create any files in magic ".phar" directory
3329
/.phar/injected-2.txt:Cannot create any files in magic ".phar" directory

ext/phar/tests/bug66960.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ var_dump(file_exists("phar://$file/". str_repeat('a', PHP_MAXPATHLEN)));
1414
var_dump(file_exists("phar://$file/". str_repeat('a', PHP_MAXPATHLEN+1)));
1515
echo 'done';
1616
?>
17-
--CLEAN--
18-
<?php
19-
$file = __DIR__ . DIRECTORY_SEPARATOR . 'bug66960.phar';
20-
unlink($file);
21-
?>
2217
--EXPECT--
2318
bool(false)
2419
bool(false)

ext/phar/tests/create_new_phar_b.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ file_put_contents('phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.pha
1212
'brand new!');
1313
include 'phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php/a.php';
1414
?>
15-
16-
--CLEAN--
17-
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
1815
--EXPECTF--
1916
Warning: file_put_contents(phar://%screate_new_phar_b.phar.php/a.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %screate_new_phar_b.php on line %d
2017

ext/phar/tests/invalid_alias.phpt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ try {
3232
echo $e->getMessage() . "\n";
3333
}
3434
?>
35-
--CLEAN--
36-
<?php
37-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar');
38-
?>
3935
--EXPECTF--
4036
Invalid alias "hi/" specified for phar "%sinvalid_alias.phar"
4137
Invalid alias "hi\l" specified for phar "%sinvalid_alias.phar"

ext/phar/tests/invalid_setstubalias.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ try {
3232
echo $e->getMessage() . "\n";
3333
}
3434

35-
?>
36-
--CLEAN--
37-
<?php
38-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.tar');
39-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.zip');
4035
?>
4136
--EXPECTF--
4237
Cannot set stub ".phar/stub.php" directly in phar "%sinvalid_setstubalias.phar.tar", use setStub

ext/phar/tests/phar_buildfromdirectory1.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ try {
1616
echo $e->getMessage() . "\n";
1717
}
1818
?>
19-
--CLEAN--
20-
<?php
21-
unlink(__DIR__ . '/buildfromdirectory1.phar');
22-
__HALT_COMPILER();
23-
?>
2419
--EXPECTF--
2520
%s(24) "UnexpectedValueException"
2621
Cannot write to archive - write operations restricted by INI setting

ext/phar/tests/phar_buildfromdirectory2.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ try {
1919
echo $e->getMessage() . "\n";
2020
}
2121
?>
22-
--CLEAN--
23-
<?php
24-
unlink(__DIR__ . '/buildfromdirectory2.phar');
25-
__HALT_COMPILER();
26-
?>
2722
--EXPECTF--
2823
%s(24) "UnexpectedValueException"
2924
RecursiveDirectoryIterator::__construct(1): Failed to open directory: No such file or directory

ext/phar/tests/phar_buildfromdirectory6.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ var_dump(file_exists(__DIR__ . '/buildfromdirectory6.phar'));
2626
?>
2727
--CLEAN--
2828
<?php
29-
unlink(__DIR__ . '/buildfromdirectory6.phar');
3029
foreach(range(1, 4) as $i) {
3130
unlink(__DIR__ . "/testdir6/file$i.txt");
3231
}

ext/phar/tests/phar_buildfromiterator1.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ try {
1717
echo $e->getMessage() . "\n";
1818
}
1919
?>
20-
--CLEAN--
21-
<?php
22-
unlink(__DIR__ . '/buildfromiterator1.phar');
23-
__HALT_COMPILER();
24-
?>
2520
--EXPECTF--
2621
%s(24) "UnexpectedValueException"
2722
Cannot write out phar archive, phar is read-only

ext/phar/tests/phar_buildfromiterator5.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ try {
4444
echo $e->getMessage() . "\n";
4545
}
4646
?>
47-
--CLEAN--
48-
<?php
49-
unlink(__DIR__ . '/buildfromiterator5.phar');
50-
__HALT_COMPILER();
51-
?>
5247
--EXPECTF--
5348
rewind
5449
valid

ext/phar/tests/phar_buildfromiterator6.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ try {
4444
echo $e->getMessage() . "\n";
4545
}
4646
?>
47-
--CLEAN--
48-
<?php
49-
unlink(__DIR__ . '/buildfromiterator6.phar');
50-
__HALT_COMPILER();
51-
?>
5247
--EXPECTF--
5348
rewind
5449
valid

ext/phar/tests/phar_buildfromiterator7.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ try {
4444
echo $e->getMessage() . "\n";
4545
}
4646
?>
47-
--CLEAN--
48-
<?php
49-
unlink(__DIR__ . '/buildfromiterator7.phar');
50-
__HALT_COMPILER();
51-
?>
5247
--EXPECTF--
5348
rewind
5449
valid

ext/phar/tests/phar_convert_again.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,8 @@ echo $e->getMessage() . "\n";
155155
--CLEAN--
156156
<?php
157157
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar');
158-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.tar');
159-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.tar.gz');
160158
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.zip');
161159
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar.gz');
162-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar');
163160
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar.bz2');
164161
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '2.tbz');
165162
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '2.phar');

ext/phar/tests/phar_convert_repeated.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.2.phar.zip');
9494
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.2.2.phar.tar');
9595
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.phar');
9696
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.2.2.3.phar.zip');
97-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.3.phar.tar');
98-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.3.phar');
9997
?>
10098
--EXPECTF--
10199
=================== new Phar() =======================

ext/phar/tests/phar_convert_repeated_b.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,10 @@ try {
7777
?>
7878
--CLEAN--
7979
<?php
80-
echo __DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.gz' . "\n";
81-
82-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.gz');
83-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar.gz');
8480
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar');
8581
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.1.2.tar');
8682
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.zip');
8783
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.1.zip');
88-
8984
?>
9085
--EXPECT--
9186
=================== new PharData() ==================

ext/phar/tests/phar_convert_tar2.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ var_dump($phar->getStub());
4444
--CLEAN--
4545
<?php
4646
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.tar.gz');
47-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.tar');
4847
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.phar.tar');
4948
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
5049
?>

ext/phar/tests/phar_convert_tar3.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ phar.readonly=0
1111

1212
$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
1313
$pname = 'phar://' . $fname;
14-
$fname2 = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.tar';
14+
$fname2 = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.tar.bz2';
1515
$fname3 = __DIR__ . '/' . basename(__FILE__, '.php') . '.2.phar.tar';
1616
$stub = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
1717
$file = $stub;
@@ -33,7 +33,7 @@ var_dump($phar->isFileFormat(Phar::TAR));
3333
var_dump($phar->isCompressed());
3434
var_dump($phar->getStub());
3535

36-
copy($fname2 . '.bz2', $fname3);
36+
copy($fname2, $fname3);
3737

3838
$phar = new Phar($fname3);
3939
var_dump($phar->isFileFormat(Phar::TAR));
@@ -45,9 +45,7 @@ var_dump($phar->getStub());
4545
<?php
4646
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.tar.bz2');
4747
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.phar.tar');
48-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.tar');
4948
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
50-
__HALT_COMPILER();
5149
?>
5250
--EXPECT--
5351
bool(false)

ext/phar/tests/phar_extract.phpt

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -105,30 +105,27 @@ try {
105105
?>
106106
--CLEAN--
107107
<?php
108-
@rmdir(__DIR__ . '/whatever');
109-
@unlink(__DIR__ . '/oops');
110-
@rmdir(__DIR__ . '/oops1');
111-
@unlink(__DIR__ . '/tempmanifest1.phar.php');
108+
unlink(__DIR__ . '/oops');
109+
rmdir(__DIR__ . '/oops1');
110+
unlink(__DIR__ . '/tempmanifest1.phar.php');
112111
$e = __DIR__ . '/extract/';
113-
@unlink($e . 'file1.txt');
114-
@unlink($e . 'file2.txt');
115-
@unlink($e . 'subdir/ectory/file.txt');
116-
@rmdir($e . 'subdir/ectory');
117-
@rmdir($e . 'subdir');
118-
@rmdir($e . 'one/level');
119-
@rmdir($e . 'one');
120-
@rmdir($e);
112+
unlink($e . 'file1.txt');
113+
unlink($e . 'file2.txt');
114+
unlink($e . 'subdir/ectory/file.txt');
115+
rmdir($e . 'subdir/ectory');
116+
rmdir($e . 'subdir');
117+
rmdir($e . 'one');
118+
rmdir($e);
121119
$e = __DIR__ . '/extract1/';
122-
@unlink($e . 'file1.txt');
123-
@unlink($e . 'subdir/ectory/file.txt');
124-
@rmdir($e . 'subdir/ectory');
125-
@rmdir($e . 'subdir');
126-
@rmdir($e);
120+
unlink($e . 'file1.txt');
121+
unlink($e . 'subdir/ectory/file.txt');
122+
rmdir($e . 'subdir/ectory');
123+
rmdir($e . 'subdir');
124+
rmdir($e);
127125
$e = __DIR__ . '/extract1-2/';
128-
@unlink($e . 'file2.txt');
129-
@rmdir($e . 'one/level');
130-
@rmdir($e . 'one');
131-
@rmdir($e);
126+
unlink($e . 'file2.txt');
127+
rmdir($e . 'one');
128+
rmdir($e);
132129
?>
133130
--EXPECTF--
134131
%sextract%cfile1.txt

ext/phar/tests/phar_gobyebye.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ opendir("foo/hi");
2727
include $pname . '/foo/hi';
2828
?>
2929
--CLEAN--
30-
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
31-
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.php'); ?>
30+
<?php
31+
@unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
32+
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.php');
33+
?>
3234
--EXPECTF--
3335
Warning: readfile(foo/hi): Failed to open stream: No such file or directory in phar://%sphar_gobyebye.phar.php/foo/hi on line %d
3436

ext/phar/tests/phar_oo_compressallbz2.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ var_dump($phar['b']->isCompressed(Phar::BZ2));
4343
?>
4444
--CLEAN--
4545
<?php
46-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar');
4746
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
4847
?>
4948
--EXPECT--

ext/phar/tests/phar_oo_compressallgz.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ echo $e->getMessage() . "\n";
4747
?>
4848
--CLEAN--
4949
<?php
50-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar');
5150
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
5251
?>
5352
--EXPECT--

ext/phar/tests/phar_oo_getmodified.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ var_dump($phar->getModified());
2626
?>
2727
--CLEAN--
2828
<?php
29-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar');
3029
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
3130
?>
3231
--EXPECT--

ext/phar/tests/phar_oo_nosig.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ var_dump($phar->getSignature());
1414
?>
1515
--CLEAN--
1616
<?php
17-
unlink(__DIR__ . '/files/phar_oo_test.phar.php');
18-
__halt_compiler();
17+
unlink(__DIR__ . '/files/phar_oo_nosig.phar.php');
1918
?>
2019
--EXPECT--
2120
bool(false)

ext/phar/tests/phar_oo_uncompressall.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ var_dump($phar['a']->isCompressed());
5151
?>
5252
--CLEAN--
5353
<?php
54-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar');
5554
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
5655
?>
5756
--EXPECT--

ext/phar/tests/phar_setalias.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ echo $phar->getAlias() . "\n";
2626
--CLEAN--
2727
<?php
2828
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
29-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phartmp.php');
30-
__HALT_COMPILER();
3129
?>
3230
--EXPECT--
3331
hio

ext/phar/tests/phar_setalias2.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ try {
3838
--CLEAN--
3939
<?php
4040
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
41-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phartmp.php');
42-
unlink(__DIR__ . '/notphar.phar');
43-
__HALT_COMPILER();
4441
?>
4542
--EXPECTF--
4643
hio

ext/phar/tests/stat2_5.3.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ __HALT_COMPILER();');
3333
include $fname3;
3434
?>
3535
--CLEAN--
36-
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?>
37-
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar'); ?>
36+
<?php
37+
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.tar');
38+
@unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar');
39+
?>
3840
--EXPECT--
3941
bool(true)
4042
is_link

ext/phar/tests/tar/bignames_overflow.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ phar.require_hash=0
77
--FILE--
88
<?php
99
$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.tar';
10-
$fname2 = __DIR__ . '/' . basename(__FILE__, '.php') . '.2.tar';
1110
$pname = 'phar://' . $fname;
1211

1312
include __DIR__ . '/files/make.dangerous.tar.php.inc';
@@ -29,7 +28,6 @@ echo $p1[str_repeat('a', 155) . '/' . str_repeat('a', 100)]->getContent() . "\n"
2928
--CLEAN--
3029
<?php
3130
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar');
32-
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.tar');
3331
?>
3432
--EXPECT--
3533
a

ext/phar/tests/tar/create_new_phar_b.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ file_put_contents('phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.pha
1212
'brand new!');
1313
include 'phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.tar/a.php';
1414
?>
15-
16-
--CLEAN--
17-
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?>
1815
--EXPECTF--
1916
Warning: file_put_contents(phar://%screate_new_phar_b.phar.tar/a.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %screate_new_phar_b.php on line %d
2017

ext/phar/tests/tar/phar_buildfromiterator5.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ try {
4444
echo $e->getMessage() . "\n";
4545
}
4646
?>
47-
--CLEAN--
48-
<?php
49-
unlink(__DIR__ . '/buildfromiterator.phar.tar');
50-
__HALT_COMPILER();
51-
?>
5247
--EXPECTF--
5348
rewind
5449
valid

ext/phar/tests/tar/phar_buildfromiterator6.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ try {
4444
echo $e->getMessage() . "\n";
4545
}
4646
?>
47-
--CLEAN--
48-
<?php
49-
unlink(__DIR__ . '/buildfromiterator.phar.tar');
50-
__HALT_COMPILER();
51-
?>
5247
--EXPECTF--
5348
rewind
5449
valid

0 commit comments

Comments
 (0)