Skip to content

Commit 293b0b0

Browse files
refactor(ext/pgsql/tests): move variable in config.inc to each test
1 parent 002fe32 commit 293b0b0

10 files changed

+9
-13
lines changed

ext/pgsql/tests/03sync_query.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ if (function_exists('pg_result_error_field')) {
8686
pg_num_rows(pg_query($db, "SELECT * FROM ".$table_name.";"));
8787
pg_num_fields(pg_query($db, "SELECT * FROM ".$table_name.";"));
8888
pg_field_name($result, 0);
89-
pg_field_num($result, $field_name);
89+
pg_field_num($result, "num");
9090
pg_field_size($result, 0);
9191
pg_field_type($result, 0);
9292
pg_field_prtlen($result, 0);

ext/pgsql/tests/04async_query.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ for ($i=0; $i < $rows; $i++)
4949
pg_num_rows(pg_query($db, "SELECT * FROM ".$table_name.";"));
5050
pg_num_fields(pg_query($db, "SELECT * FROM ".$table_name.";"));
5151
pg_field_name($result, 0);
52-
pg_field_num($result, $field_name);
52+
pg_field_num($result, "num");
5353
pg_field_size($result, 0);
5454
pg_field_type($result, 0);
5555
pg_field_prtlen($result, 0);

ext/pgsql/tests/23sync_query_params.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pg_result_error($result);
4343
pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
4444
pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
4545
pg_field_name($result, 0);
46-
pg_field_num($result, $field_name);
46+
pg_field_num($result, "num");
4747
pg_field_size($result, 0);
4848
pg_field_type($result, 0);
4949
pg_field_prtlen($result, null, 0);

ext/pgsql/tests/24sync_query_prepared.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pg_result_error($result);
4646
pg_num_rows(pg_execute($db, "php_test", array(100)));
4747
pg_num_fields(pg_execute($db, "php_test", array(100)));
4848
pg_field_name($result, 0);
49-
pg_field_num($result, $field_name);
49+
pg_field_num($result, "num");
5050
pg_field_size($result, 0);
5151
pg_field_type($result, 0);
5252
pg_field_prtlen($result, 0);

ext/pgsql/tests/25async_query_params.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ for ($i=0; $i < $rows; $i++)
5151
pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
5252
pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
5353
pg_field_name($result, 0);
54-
pg_field_num($result, $field_name);
54+
pg_field_num($result, "num");
5555
pg_field_size($result, 0);
5656
pg_field_type($result, 0);
5757
pg_field_prtlen($result, 0);

ext/pgsql/tests/26async_query_prepared.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ for ($i=0; $i < $rows; $i++)
6565
pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
6666
pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
6767
pg_field_name($result, 0);
68-
pg_field_num($result, $field_name);
68+
pg_field_num($result, "num");
6969
pg_field_size($result, 0);
7070
pg_field_type($result, 0);
7171
pg_field_prtlen($result, 0);

ext/pgsql/tests/30nb_async_query_params.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ for ($i=0; $i < $rows; $i++) {
5252
pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
5353
pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
5454
pg_field_name($result, 0);
55-
pg_field_num($result, $field_name);
55+
pg_field_num($result, "num");
5656
pg_field_size($result, 0);
5757
pg_field_type($result, 0);
5858
pg_field_prtlen($result, 0);

ext/pgsql/tests/31nb_async_query_prepared.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ for ($i=0; $i < $rows; $i++) {
6767
pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
6868
pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
6969
pg_field_name($result, 0);
70-
pg_field_num($result, $field_name);
70+
pg_field_num($result, "num");
7171
pg_field_size($result, 0);
7272
pg_field_type($result, 0);
7373
pg_field_prtlen($result, 0);

ext/pgsql/tests/32nb_async_query.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ for ($i=0; $i < $rows; $i++) {
5353
pg_num_rows(pg_query($db, "SELECT * FROM ".$table_name.";"));
5454
pg_num_fields(pg_query($db, "SELECT * FROM ".$table_name.";"));
5555
pg_field_name($result, 0);
56-
pg_field_num($result, $field_name);
56+
pg_field_num($result, "num");
5757
pg_field_size($result, 0);
5858
pg_field_type($result, 0);
5959
pg_field_prtlen($result, null, 0);

ext/pgsql/tests/inc/config.inc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,4 @@
66

77
// "test" database must exist. i.e. "createdb test" before testing
88
$conn_str = getenv('PGSQL_TEST_CONNSTR') ?: "host=localhost dbname=test port=5432 user=postgres password=postgres"; // connection string
9-
10-
// Test table
11-
$field_name = "num"; // For pg_field_num()
12-
139
?>

0 commit comments

Comments
 (0)