From 5795e0eceb35f2eb4b5afcf284fa0a1c95718592 Mon Sep 17 00:00:00 2001 From: yitam Date: Thu, 9 Mar 2017 14:12:53 -0800 Subject: [PATCH] one more test --- .../sqlsrv_param_query_array_inputs.phpt | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 test/sqlsrv/sqlsrv_param_query_array_inputs.phpt diff --git a/test/sqlsrv/sqlsrv_param_query_array_inputs.phpt b/test/sqlsrv/sqlsrv_param_query_array_inputs.phpt new file mode 100644 index 00000000..6174d36b --- /dev/null +++ b/test/sqlsrv/sqlsrv_param_query_array_inputs.phpt @@ -0,0 +1,158 @@ +--TEST-- +Test insert various numeric data types and fetch them back as strings +--FILE-- +$username, "PWD"=>$password); + $conn = sqlsrv_connect($serverName, $connectionInfo); + if( !$conn ) { FatalError("Could not connect.\n"); } + + $numRows = 5; + + ExecData_Value($conn, $numRows); + ExecData_Value($conn, $numRows, SQLSRV_PHPTYPE_INT); + ExecData_Param($conn, $numRows, true); + ExecData_Param($conn, $numRows); + + sqlsrv_close($conn); + } + catch (Exception $e) + { + echo $e->getMessage(); + } + echo "\nDone\n"; + EndTest("sqlsrv_param_query_array_inputs"); +} + +Repro(); + +?> +--EXPECT-- + +...Starting 'sqlsrv_param_query_array_inputs' test... +Insert integers without PHP type +1, 2 +11, 12 +21, 22 +31, 32 +41, 42 +Insert integers as SQLSRV_PHPTYPE_INT +1, 2 +11, 12 +21, 22 +31, 32 +41, 42 +Insert floats with direction specified +1.0, 2.0 +11.0, 12.0 +21.0, 22.0 +31.0, 32.0 +41.0, 42.0 +Insert floats without direction +1.0, 2.0 +11.0, 12.0 +21.0, 22.0 +31.0, 32.0 +41.0, 42.0 + +Done +...Test 'sqlsrv_param_query_array_inputs' completed successfully.