Skip to content

Commit c2ceb00

Browse files
committed
get post always discard output
1 parent f14bbef commit c2ceb00

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

test/phpunit-bootstrap.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,8 @@ function post(string $phpfile, array $post_data): void
7474
ob_start();
7575
try {
7676
include $phpfile;
77-
ob_get_clean(); // discard output
78-
} catch (Throwable $e) {
79-
error_log(ob_get_clean()); // don't discard output
80-
throw $e;
8177
} finally {
78+
ob_get_clean(); // discard output
8279
unset($_POST);
8380
unset($_SERVER["REQUEST_METHOD"]);
8481
}
@@ -91,11 +88,8 @@ function get(string $phpfile): void
9188
ob_start();
9289
try {
9390
include $phpfile;
94-
ob_get_clean(); // discard output
95-
} catch (Throwable $e) {
96-
error_log(ob_get_clean()); // don't discard output
97-
throw $e;
9891
} finally {
92+
ob_get_clean(); // discard output
9993
unset($_SERVER["REQUEST_METHOD"]);
10094
}
10195
}

0 commit comments

Comments
 (0)