From 978108578283b41b56a129bea5f85c1bac7bf8a7 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 5 Jan 2022 16:45:36 +0100 Subject: [PATCH] Fix ODBC test which may not properly clean up If these tests fail with a fatal error, they won't properly clean up, which likely causes other tests to fail as (several ODBC tests use the `odbcTEST` database and tables or stored procedures named `FOO`). This is particularly annoying during development, where you would need to clean up manually. We fix this by moving the cleanup code to the --CLEAN-- section, so that this code is executed no matter what. Closes GH-7886. --- ext/odbc/tests/odbc_exec_002.phpt | 8 +++++--- ext/odbc/tests/odbc_free_result_001.phpt | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ext/odbc/tests/odbc_exec_002.phpt b/ext/odbc/tests/odbc_exec_002.phpt index 309497e6c6b..437532535af 100644 --- a/ext/odbc/tests/odbc_exec_002.phpt +++ b/ext/odbc/tests/odbc_exec_002.phpt @@ -21,11 +21,13 @@ $res = odbc_exec($conn, 'SELECT * FROM FOO'); var_dump(odbc_fetch_row($res)); var_dump(odbc_result($res, 'test')); var_dump(odbc_fetch_array($res)); - +?> +--CLEAN-- + --EXPECT-- bool(true) diff --git a/ext/odbc/tests/odbc_free_result_001.phpt b/ext/odbc/tests/odbc_free_result_001.phpt index 09b3e435fbb..19660618f14 100644 --- a/ext/odbc/tests/odbc_free_result_001.phpt +++ b/ext/odbc/tests/odbc_free_result_001.phpt @@ -37,11 +37,13 @@ try { } catch (TypeError $e) { echo $e->getMessage(), "\n"; } - +?> +--CLEAN-- + --EXPECT-- bool(true)