Skip to content

Commit ca0a1e7

Browse files
committed
review: switched concurrency fixture cleanup to --CLEAN--
1 parent 5ef1b7a commit ca0a1e7

2 files changed

Lines changed: 23 additions & 15 deletions

File tree

tests/run-test/max_concurrency_conflicts.phpt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,15 @@ var_dump($exitCode);
9090
if ($exitCode !== 0) {
9191
echo $output;
9292
}
93-
94-
foreach (glob($root . '/*') as $file) {
95-
unlink($file);
93+
?>
94+
--CLEAN--
95+
<?php
96+
foreach (glob(__DIR__ . '/max_concurrency_conflicts_*') ?: [] as $root) {
97+
foreach (glob($root . '/*') ?: [] as $file) {
98+
@unlink($file);
99+
}
100+
@rmdir($root);
96101
}
97-
rmdir($root);
98102
?>
99103
--EXPECT--
100104
PASSED one.phpt

tests/run-test/scoped_conflicts.phpt

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,23 @@ var_dump($exitCode);
120120
if ($exitCode !== 0) {
121121
echo $output;
122122
}
123-
124-
foreach (glob($root . '/active-*') as $marker) {
125-
unlink($marker);
126-
}
127-
unlink($results);
128-
foreach ([$group, $external] as $directory) {
129-
foreach (glob($directory . '/*') as $file) {
130-
unlink($file);
123+
?>
124+
--CLEAN--
125+
<?php
126+
foreach (glob(__DIR__ . '/scoped_conflicts_*') ?: [] as $root) {
127+
foreach ([$root . '/a-group', $root . '/z-external'] as $directory) {
128+
foreach (glob($directory . '/*') ?: [] as $file) {
129+
@unlink($file);
130+
}
131+
@rmdir($directory);
132+
}
133+
foreach (glob($root . '/*') ?: [] as $file) {
134+
if (is_file($file)) {
135+
@unlink($file);
136+
}
131137
}
138+
@rmdir($root);
132139
}
133-
rmdir($group);
134-
rmdir($external);
135-
rmdir($root);
136140
?>
137141
--EXPECT--
138142
PASSED one.phpt

0 commit comments

Comments
 (0)