diff --git a/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_inout_bit.phpt b/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_inout_bit.phpt index 450b469a..290ab9b4 100644 --- a/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_inout_bit.phpt +++ b/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_inout_bit.phpt @@ -7,15 +7,12 @@ false as a bit, a true value cast to a bit, a true value as an int. --ENV-- PHPT_EXEC=true --SKIPIF-- - + --FILE-- diff --git a/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_inout_bool.phpt b/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_inout_bool.phpt index 33e56967..ff734cf8 100644 --- a/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_inout_bool.phpt +++ b/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_inout_bool.phpt @@ -7,15 +7,12 @@ false as a bool, a true value cast to a bool, a true value as an bool. --ENV-- PHPT_EXEC=true --SKIPIF-- - + --FILE-- diff --git a/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_out_bit.phpt b/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_out_bit.phpt index d4660ade..8b5147ba 100644 --- a/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_out_bit.phpt +++ b/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_out_bit.phpt @@ -7,17 +7,12 @@ false as a bit, a true value cast to a bit, a true value as an int. --ENV-- PHPT_EXEC=true --SKIPIF-- - + --FILE-- diff --git a/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_out_bool.phpt b/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_out_bool.phpt index 9da6c832..59551367 100644 --- a/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_out_bool.phpt +++ b/test/functional/sqlsrv/sqlsrv_bug_boolean_cast_out_bool.phpt @@ -7,17 +7,12 @@ false as a bool, a true value cast to a bool, a true value as an bool. --ENV-- PHPT_EXEC=true --SKIPIF-- - + --FILE-- diff --git a/test/functional/sqlsrv/sqlsrv_complex_query.phpt b/test/functional/sqlsrv/sqlsrv_complex_query.phpt index b09fe81f..59eb7b17 100644 --- a/test/functional/sqlsrv/sqlsrv_complex_query.phpt +++ b/test/functional/sqlsrv/sqlsrv_complex_query.phpt @@ -1,23 +1,69 @@ --TEST-- Test a complex query with IDENTITY_INSERT +--DESCRIPTION-- +Verifies the behavior of INSERT queries with and without the IDENTITY flag set. +This test is similar to the other test TC33_ComplexQuery but using UTF-8 data +--SKIPIF-- + --FILE--  $input) { + array_push($params, $inputs[$key]); + } + if (! is_null($query)) { + // this contains a batch of sql statements, + // with set identity_insert on or off + // thus, sqlsrv_query should be called + $sql = str_replace("SQL", $insertSql, $query); + $stmt = sqlsrv_query($conn, $sql, $params); + } else { + // just a regular insert, so use sqlsrv_prepare + $sql = $insertSql; + $stmt = sqlsrv_prepare($conn, $sql, $params); + if ($stmt) { + sqlsrv_execute($stmt); + } + } + } + + return $stmt; +} + +function complexQuery() { set_time_limit(0); sqlsrv_configure('WarningsReturnAsErrors', 1); // Connect - $conn = connect(array("CharacterSet"=>"UTF-8")); - if (!$conn) { - fatalError("Could not connect.\n"); + $conn = AE\connect(array("CharacterSet"=>"UTF-8")); + + $tableName = 'complex_query_test'; + $columns = array(new AE\ColumnMeta('int', 'c1_int', "IDENTITY"), + new AE\ColumnMeta('tinyint', 'c2_tinyint'), + new AE\ColumnMeta('smallint', 'c3_smallint'), + new AE\ColumnMeta('bigint', 'c4_bigint'), + new AE\ColumnMeta('varchar(512)', 'c5_varchar')); + $stmt = AE\createTable($conn, $tableName, $columns); + if (!$stmt) { + fatalError("Failed to create table $tableName\n"); } - - $tableName = GetTempTableName(); - - $stmt = sqlsrv_query($conn, "CREATE TABLE $tableName ([c1_int] int IDENTITY, [c2_tinyint] tinyint, [c3_smallint] smallint, [c4_bigint] bigint, [c5_varchar] varchar(512))"); sqlsrv_free_stmt($stmt); $noExpectedRows = 0; @@ -26,12 +72,16 @@ function ComplexQuery() sqlsrv_free_stmt($stmt); $noExpectedRows++; - $stmt = sqlsrv_query($conn, "INSERT INTO $tableName (c1_int, c2_tinyint, c3_smallint, c4_bigint, c5_varchar) VALUES (1324944463, 105, 18521, 2022363960, 'üv£ª©*@*rãCaC|/ä*,,@ý©bvªäîCUBão_+ßZhUªî¢~ÖÜ/ª@ä+ßßar~Özr,aß/,bCaü<ÖÐhÐbß<î/ðzãý+bÜ:Zßöüª@BÖUßUßaåab|¢ª¢|ü£/ÃßzzuªãA.ªZUöß<©a>OzübBüÜ|bZ./öbvß*rbö>ß©r//~ÖCÜhð¢bßz:¢Ä+_Ã__£ý£Uýh:v¢bý,©Ü£©,A:Zh>ßåvö+Ä>Ã.ßvC|:Ü*Üü*åz|b.©©üAý@uU.oOÜýAÜÐÜð©OB|rrîbU<övoUßäZÃÖ<ÄåªAÄ.Ua*ÖOªB,åîzB:ÜhövÖZhýðüC')"); + $inputs = array("c1_int" => 1324944463, "c2_tinyint" => 105, "c3_smallint" => 18521, "c4_bigint" => 2022363960, "c5_varchar" => "üv£ª©*@*rãCaC|/ä*,,@ý©bvªäîCUBão_+ßZhUªî¢~ÖÜ/ª@ä+ßßar~Özr,aß/,bCaü<ÖÐhÐbß<î/ðzãý+bÜ:Zßöüª@BÖUßUßaåab|¢ª¢|ü£/ÃßzzuªãA.ªZUöß<©a>OzübBüÜ|bZ./öbvß*rbö>ß©r//~ÖCÜhð¢bßz:¢Ä+_Ã__£ý£Uýh:v¢bý,©Ü£©,A:Zh>ßåvö+Ä>Ã.ßvC|:Ü*Üü*åz|b.©©üAý@uU.oOÜýAÜÐÜð©OB|rrîbU<övoUßäZÃÖ<ÄåªAÄ.Ua*ÖOªB,åîzB:ÜhövÖZhýðüC"); + $stmt = AE\insertRow($conn, $tableName, $inputs); + unset($inputs); sqlsrv_free_stmt($stmt); $stmt = sqlsrv_query($conn, "SET IDENTITY_INSERT $tableName OFF;"); sqlsrv_free_stmt($stmt); - $stmt = sqlsrv_query($conn, "INSERT INTO $tableName (c1_int, c2_tinyint, c3_smallint, c4_bigint, c5_varchar) VALUES (-1554807493, 253, -12809, -1698802997, 'ßöîÄ@v+oß+î|ruý*Ü¢ãÖ~.*ArABªßOBzUU£ßUuÜ<ðýr|b~_äaü/OÖzv.¢ä>>OÜ+¢vªzöªoB_ä+ߪrÜö£>U~ãÖð~ðýur,ÖvZh¢ªZ>vªUäåîz,>ÃräðäýðO_ä*a,ö+üÐß~bÃü¢<<+îýÐöäªO/zA+:îZ,öBÐü<î£îåhBÖzßÄ~,:>bð<~aÐãö¢*¢våvÃÐåî@a_Äu£öa~våu>¢Bã©å:Aßã£Üvåö+aä£U<¢b@|zbãÖ@ÃãUb|ÄB£©,~ßð©ðUßöZÜöî£Zz<>åäZßð©ßaÖÖ¢bð£ßÄ>îÃÃ.~z>h_ý~ÜrüÖBruß+ª©CB©O>rå,Chro,£ßbZ_ß©,ÃUu|ßåüÄ/ý*åu|~Ö.ßZUoä:~A~CZhðU|öZ:ä/£Ä*î©ÄhävhbrzîÐ@.rãß©@uÜ©~>ÖÜööCÄzÜCü+>oZÄÜ/ABßA_b|b¢bÜh<|uBr.B*rü>aCª|AÄ©@öÖßÖ~Ö -1554807493, "c2_tinyint" => 253, "c3_smallint" => -12809, "c4_bigint" => -1698802997, "c5_varchar" => "ßöîÄ@v+oß+î|ruý*Ü¢ãÖ~.*ArABªßOBzUU£ßUuÜ<ðýr|b~_äaü/OÖzv.¢ä>>OÜ+¢vªzöªoB_ä+ߪrÜö£>U~ãÖð~ðýur,ÖvZh¢ªZ>vªUäåîz,>ÃräðäýðO_ä*a,ö+üÐß~bÃü¢<<+îýÐöäªO/zA+:îZ,öBÐü<î£îåhBÖzßÄ~,:>bð<~aÐãö¢*¢våvÃÐåî@a_Äu£öa~våu>¢Bã©å:Aßã£Üvåö+aä£U<¢b@|zbãÖ@ÃãUb|ÄB£©,~ßð©ðUßöZÜöî£Zz<>åäZßð©ßaÖÖ¢bð£ßÄ>îÃÃ.~z>h_ý~ÜrüÖBruß+ª©CB©O>rå,Chro,£ßbZ_ß©,ÃUu|ßåüÄ/ý*åu|~Ö.ßZUoä:~A~CZhðU|öZ:ä/£Ä*î©ÄhävhbrzîÐ@.rãß©@uÜ©~>ÖÜööCÄzÜCü+>oZÄÜ/ABßA_b|b¢bÜh<|uBr.B*rü>aCª|AÄ©@öÖßÖ~ÖüoîzÄ¢zz~Ãýö|vUå>|CÄUü~>buÃv<ä~Ö+.ü*ªbuî_bBC©.oîCbåîÐÖUa~/U>öAäÐBu~ozîZ/zrOOä:ß©bßo.ü©A¢höÖoßÖü>r+A/ßaªrß:ª@|bhhªª/oå<Ö:rüa+oC¢~uÄü>/.ãbOöª_b@bbߢ|uzߪ֢~uäýub©ãaZäC£ÄrÖ,üöäu+Ãîö|||,U.BråãoýbüåöÃburöoî+>öä©î,u_öb©@C:ÜåÜîÜåAÖzýbð|Z<Ãý.£rîZ|/z@¢£AýZ,ßuZ*:b.AzТä¢üßöbvbväð|<**~Uv.Ð*Ä©B*ýCUöa¢åO©Ãß*ÃÃ|ÜðA@îÃßaBöüahUUA+ߣ_u|~äö.©hr£oBo<äãüO+_åO:Z~Üoîßzb£ª£A.AÖÜÄ._O_å£ß');SET IDENTITY_INSERT $tableName OFF;"); + if (AE\isColEncrypted()) { + // When AE is enabled, SQL types must be specified for sqlsrv_query + $inputs = array("c1_int" => array(1994559593, null, null, SQLSRV_SQLTYPE_INT), + "c2_tinyint" => array(129, null, null, SQLSRV_SQLTYPE_TINYINT), + "c3_smallint" => array(-8455, null, null, SQLSRV_SQLTYPE_SMALLINT), + "c4_bigint" => array(-236232445, null, null, SQLSRV_SQLTYPE_BIGINT), + "c5_varchar" => array("ߣ*ÐO+ö+<ã:>üoîzÄ¢zz~Ãýö|vUå>|CÄUü~>buÃv<ä~Ö+.ü*ªbuî_bBC©.oîCbåîÐÖUa~/U>öAäÐBu~ozîZ/zrOOä:ß©bßo.ü©A¢höÖoßÖü>r+A/ßaªrß:ª@|bhhªª/oå<Ö:rüa+oC¢~uÄü>/.ãbOöª_b@bbߢ|uzߪ֢~uäýub©ãaZäC£ÄrÖ,üöäu+Ãîö|||,U.BråãoýbüåöÃburöoî+>öä©î,u_öb©@C:ÜåÜîÜåAÖzýbð|Z<Ãý.£rîZ|/z@¢£AýZ,ßuZ*:b.AzТä¢üßöbvbväð|<**~Uv.Ð*Ä©B*ýCUöa¢åO©Ãß*ÃÃ|ÜðA@îÃßaBöüahUUA+ߣ_u|~äö.©hr£oBo<äãüO+_åO:Z~Üoîßzb£ª£A.AÖÜÄ._O_å£ß", null, null, SQLSRV_SQLTYPE_VARCHAR(512))); + } else { + $inputs = array("c1_int" => 1994559593, "c2_tinyint" => 129, "c3_smallint" => -8455, "c4_bigint" => -236232445, "c5_varchar" => "ߣ*ÐO+ö+<ã:>üoîzÄ¢zz~Ãýö|vUå>|CÄUü~>buÃv<ä~Ö+.ü*ªbuî_bBC©.oîCbåîÐÖUa~/U>öAäÐBu~ozîZ/zrOOä:ß©bßo.ü©A¢höÖoßÖü>r+A/ßaªrß:ª@|bhhªª/oå<Ö:rüa+oC¢~uÄü>/.ãbOöª_b@bbߢ|uzߪ֢~uäýub©ãaZäC£ÄrÖ,üöäu+Ãîö|||,U.BråãoýbüåöÃburöoî+>öä©î,u_öb©@C:ÜåÜîÜåAÖzýbð|Z<Ãý.£rîZ|/z@¢£AýZ,ßuZ*:b.AzТä¢üßöbvbväð|<**~Uv.Ð*Ä©B*ýCUöa¢åO©Ãß*ÃÃ|ÜðA@îÃßaBöüahUUA+ߣ_u|~äö.©hr£oBo<äãüO+_åO:Z~Üoîßzb£ª£A.AÖÜÄ._O_å£ß"); + } + $query = "SET IDENTITY_INSERT [$tableName] ON; SQL; SET IDENTITY_INSERT [$tableName] OFF;"; + $stmt = insertTest($conn, $tableName, $inputs, $query); + print_r(sqlsrv_errors()); + unset($inputs); sqlsrv_free_stmt($stmt); echo "Number of rows inserted: $noExpectedRows\n"; @@ -60,28 +123,19 @@ function ComplexQuery() if ($noActualRows != $noExpectedRows) { echo("Number of rows does not match expected value\n"); } + + dropTable($conn, $tableName); sqlsrv_close($conn); } -//-------------------------------------------------------------------- -// Repro -// -//-------------------------------------------------------------------- -function Repro() -{ - startTest("sqlsrv_statement_complex_query"); - echo "\nTest begins...\n"; +echo "\nTest begins...\n"; - try { - ComplexQuery(); - } catch (Exception $e) { - echo $e->getMessage(); - } - echo "\nDone\n"; - endTest("sqlsrv_statement_complex_query"); +try { + complexQuery(); +} catch (Exception $e) { + echo $e->getMessage(); } - -Repro(); +echo "\nDone\n"; ?> --EXPECTREGEX-- @@ -94,4 +148,3 @@ Number of rows inserted: 2 Number of rows fetched: 2 Done -Test \"sqlsrv_statement_complex_query\" completed successfully\. diff --git a/test/functional/sqlsrv/sqlsrv_data_types_explict_fetch.phpt b/test/functional/sqlsrv/sqlsrv_data_types_explict_fetch.phpt index 4a694b28..476f9a3c 100644 --- a/test/functional/sqlsrv/sqlsrv_data_types_explict_fetch.phpt +++ b/test/functional/sqlsrv/sqlsrv_data_types_explict_fetch.phpt @@ -1,45 +1,64 @@ --TEST-- Test insert various data types and fetch as strings +--SKIPIF-- + --FILE-- "UTF-8"); - $conn = connect($connectionInfo); - if (!$conn) { - fatalError("Could not connect.\n"); + $conn = AE\connect($connectionInfo); + + $tableName = 'types_explict_fetch'; + $columns = array(new AE\ColumnMeta('int', 'c1_int'), + new AE\ColumnMeta('tinyint', 'c2_tinyint'), + new AE\ColumnMeta('smallint', 'c3_smallint'), + new AE\ColumnMeta('bigint', 'c4_bigint'), + new AE\ColumnMeta('bit', 'c5_bit'), + new AE\ColumnMeta('float', 'c6_float'), + new AE\ColumnMeta('real', 'c7_real'), + new AE\ColumnMeta('decimal(28,4)', 'c8_decimal'), + new AE\ColumnMeta('numeric(32,4)', 'c9_numeric'), + new AE\ColumnMeta('money', 'c10_money', null, true, true), + new AE\ColumnMeta('smallmoney', 'c11_smallmoney', null, true, true), + new AE\ColumnMeta('char(512)', 'c12_char'), + new AE\ColumnMeta('varchar(512)', 'c13_varchar'), + new AE\ColumnMeta('varchar(max)', 'c14_varchar_max'), + new AE\ColumnMeta('uniqueidentifier', 'c15_uniqueidentifier'), + new AE\ColumnMeta('datetime', 'c16_datetime'), + new AE\ColumnMeta('smalldatetime', 'c17_smalldatetime'), + new AE\ColumnMeta('timestamp', 'c18_timestamp') + ); + $stmt = AE\createTable($conn, $tableName, $columns); + if (!$stmt) { + fatalError("Failed to create table $tableName\n"); } - $tableName = GetTempTableName(); - - $stmt = sqlsrv_query($conn, "CREATE TABLE [$tableName] ([c1_int] int, [c2_tinyint] tinyint, [c3_smallint] smallint, [c4_bigint] bigint, [c5_bit] bit, [c6_float] float, [c7_real] real, [c8_decimal] decimal(28,4), [c9_numeric] numeric(32,4), [c10_money] money, [c11_smallmoney] smallmoney, [c12_char] char(512), [c13_varchar] varchar(512), [c14_varchar_max] varchar(max), [c15_uniqueidentifier] uniqueidentifier, [c16_datetime] datetime, [c17_smalldatetime] smalldatetime, [c18_timestamp] timestamp)"); - sqlsrv_free_stmt($stmt); - $numRows = 0; - $data = GetInputData(++$numRows); - $stmt = sqlsrv_query($conn, "INSERT INTO [$tableName] (c1_int, c2_tinyint, c3_smallint, c4_bigint, c5_bit, c6_float, c7_real, c8_decimal, c9_numeric, c10_money, c11_smallmoney, c12_char, c13_varchar, c14_varchar_max, c15_uniqueidentifier, c16_datetime, c17_smalldatetime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $data); + $data = getInputData(++$numRows); + $stmt = AE\executeQueryParams($conn, "INSERT INTO [$tableName] (c1_int, c2_tinyint, c3_smallint, c4_bigint, c5_bit, c6_float, c7_real, c8_decimal, c9_numeric, c10_money, c11_smallmoney, c12_char, c13_varchar, c14_varchar_max, c15_uniqueidentifier, c16_datetime, c17_smalldatetime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $data); sqlsrv_free_stmt($stmt); - $data = GetInputData(++$numRows); - $stmt = sqlsrv_query($conn, "INSERT INTO [$tableName] (c1_int, c2_tinyint, c3_smallint, c4_bigint, c5_bit, c6_float, c7_real, c8_decimal, c9_numeric, c10_money, c11_smallmoney, c12_char, c13_varchar, c14_varchar_max, c15_uniqueidentifier, c16_datetime, c17_smalldatetime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $data); + $data = getInputData(++$numRows); + $stmt = AE\executeQueryParams($conn, "INSERT INTO [$tableName] (c1_int, c2_tinyint, c3_smallint, c4_bigint, c5_bit, c6_float, c7_real, c8_decimal, c9_numeric, c10_money, c11_smallmoney, c12_char, c13_varchar, c14_varchar_max, c15_uniqueidentifier, c16_datetime, c17_smalldatetime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $data); sqlsrv_free_stmt($stmt); - $data = GetInputData(++$numRows); - $stmt = sqlsrv_query($conn, "INSERT INTO [$tableName] (c1_int, c2_tinyint, c3_smallint, c4_bigint, c5_bit, c6_float, c7_real, c8_decimal, c9_numeric, c10_money, c11_smallmoney, c12_char, c13_varchar, c14_varchar_max, c15_uniqueidentifier, c16_datetime, c17_smalldatetime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $data); + $data = getInputData(++$numRows); + $stmt = AE\executeQueryParams($conn, "INSERT INTO [$tableName] (c1_int, c2_tinyint, c3_smallint, c4_bigint, c5_bit, c6_float, c7_real, c8_decimal, c9_numeric, c10_money, c11_smallmoney, c12_char, c13_varchar, c14_varchar_max, c15_uniqueidentifier, c16_datetime, c17_smalldatetime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $data); sqlsrv_free_stmt($stmt); - $data = GetInputData(++$numRows); - $stmt = sqlsrv_query($conn, "INSERT INTO [$tableName] (c1_int, c2_tinyint, c3_smallint, c4_bigint, c5_bit, c6_float, c7_real, c8_decimal, c9_numeric, c10_money, c11_smallmoney, c12_char, c13_varchar, c14_varchar_max, c15_uniqueidentifier, c16_datetime, c17_smalldatetime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $data); + $data = getInputData(++$numRows); + $stmt = AE\executeQueryParams($conn, "INSERT INTO [$tableName] (c1_int, c2_tinyint, c3_smallint, c4_bigint, c5_bit, c6_float, c7_real, c8_decimal, c9_numeric, c10_money, c11_smallmoney, c12_char, c13_varchar, c14_varchar_max, c15_uniqueidentifier, c16_datetime, c17_smalldatetime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $data); sqlsrv_free_stmt($stmt); - $stmt = sqlsrv_query($conn, "SELECT * FROM $tableName ORDER BY c18_timestamp"); + $stmt = AE\executeQuery($conn, "SELECT * FROM $tableName ORDER BY c18_timestamp"); $metadata = sqlsrv_field_metadata($stmt); $numFields = count($metadata); @@ -49,10 +68,11 @@ function ExplicitFetch() echo "Number of Actual Rows $noActualRows is unexpected!\n"; } + dropTable($conn, $tableName); sqlsrv_close($conn); } -function GetInputData($index) +function getInputData($index) { switch ($index) { case 1: @@ -68,20 +88,13 @@ function GetInputData($index) } } -function Repro() -{ - startTest("sqlsrv_data_types_explict_fetch"); - echo "\nTest begins...\n"; - try { - ExplicitFetch(); - } catch (Exception $e) { - echo $e->getMessage(); - } - echo "\nDone\n"; - endTest("sqlsrv_data_types_explict_fetch"); +echo "\nTest begins...\n"; +try { + explicitFetch(); +} catch (Exception $e) { + echo $e->getMessage(); } - -Repro(); +echo "\nDone\n"; ?> --EXPECT-- @@ -93,4 +106,3 @@ Comparing data in row 3 Comparing data in row 4 Done -Test "sqlsrv_data_types_explict_fetch" completed successfully. diff --git a/test/functional/sqlsrv/srv_007_login_timeout.phpt b/test/functional/sqlsrv/srv_007_login_timeout.phpt index 5ac33c9f..c8fa5cf1 100644 --- a/test/functional/sqlsrv/srv_007_login_timeout.phpt +++ b/test/functional/sqlsrv/srv_007_login_timeout.phpt @@ -9,11 +9,11 @@ Intentionally provide an invalid server name and set LoginTimeout. Verify the ti $serverName = "WRONG_SERVER_NAME"; -$t0 = round(microtime(true)); +$t0 = microtime(true); -$conn = sqlsrv_connect( $serverName , array("LoginTimeout" => 8)); +$conn = sqlsrv_connect($serverName , array("LoginTimeout" => 8)); -$t1 = round(microtime(true)); +$t1 = microtime(true); echo "Connection attempt time: " . ($t1 - $t0) . " [sec]\n"; @@ -21,5 +21,5 @@ print "Done"; ?> --EXPECTREGEX-- -Connection attempt time: [7-9] \[sec\] +Connection attempt time: [7-9]\.[0-9]+ \[sec\] Done