Skip to content

Commit 2c77d94

Browse files
committed
review: switched fork server fixture cleanup to --CLEAN--
1 parent 352ea7c commit 2c77d94

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

sapi/cli/tests/test_fork_server.phpt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,15 @@ $output = stream_get_contents($pipes[1]);
102102
fclose($pipes[1]);
103103
$exitCode = proc_close($process);
104104

105-
foreach (array_keys($scripts) as $file) {
106-
unlink($file);
107-
}
108-
109105
echo str_replace("\0", '|', $output);
110106
var_dump($exitCode);
111107
?>
108+
--CLEAN--
109+
<?php
110+
for ($i = 1; $i <= 6; $i++) {
111+
@unlink(__DIR__ . "/test_fork_server_$i.php");
112+
}
113+
?>
112114
--EXPECT--
113115
|TESTTOKEN:B:0|first
114116
pipe

tests/run-test/fork_server_lifecycle.phpt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,15 @@ var_dump($failureExit);
174174
if ($failureExit !== 0 || count($failureStatuses) !== 1) {
175175
echo $failureOutput;
176176
}
177-
178-
foreach (glob($root . '/*') as $file) {
179-
unlink($file);
177+
?>
178+
--CLEAN--
179+
<?php
180+
foreach (glob(__DIR__ . '/fork_server_lifecycle_*') ?: [] as $root) {
181+
foreach (glob($root . '/*') ?: [] as $file) {
182+
@unlink($file);
183+
}
184+
@rmdir($root);
180185
}
181-
rmdir($root);
182186
?>
183187
--EXPECT--
184188
timeout PASSED after.phpt

0 commit comments

Comments
 (0)