test fixes for PHP 7.2

This commit is contained in:
lilgreenbird 2017-07-21 16:56:16 -07:00
parent 2ab756ee6d
commit 3e8b44546f
4 changed files with 9 additions and 9 deletions

View file

@ -35,8 +35,8 @@ function ConnectionTest()
// Valid connection attempt => no errors are expected
Trace("\nValid connection attempt (to $server) ....\n");
$conn2 = Connect();
$errors = sqlsrv_errors(SQLSRV_ERR_ERRORS);
if(count($errors) != 0)
$errors = sqlsrv_errors(SQLSRV_ERR_ERRORS);
if (!empty($errors) && count($errors) != 0)
{
die("No errors were expected on valid connection attempts.");
}

File diff suppressed because one or more lines are too long

View file

@ -72,7 +72,7 @@ function FetchField($stmt, $idx, $numFields, $errorExpected)
function PrintError($errorExpected = true)
{
$errors = sqlsrv_errors(SQLSRV_ERR_ALL);
if (count($errors) > 0)
if (!empty($errors) && count($errors) > 0)
{
$e = $errors[0];
var_dump($e['message']);

View file

@ -52,7 +52,7 @@ sqlsrv_close($conn);
?>
--EXPECTREGEX--
Notice\: Use of undefined constant SQLSRV_ENC_UNKNOWN - assumed \'SQLSRV_ENC_UNKNOWN\' in .+(\/|\\)sqlsrv_input_param_unknown_encoding\.php on line 26
(Warning|Notice)\: Use of undefined constant SQLSRV_ENC_UNKNOWN - assumed \'SQLSRV_ENC_UNKNOWN\' (\(this will throw an Error in a future version of PHP\) )?in .+(\/|\\)sqlsrv_input_param_unknown_encoding\.php on line 26
Array
\(
\[0\] => Array
@ -67,7 +67,7 @@ Array
\)
Notice\: Use of undefined constant SQLSRV_ENC_UNKNOWN - assumed \'SQLSRV_ENC_UNKNOWN\' in .+(\/|\\)sqlsrv_input_param_unknown_encoding\.php on line 33
(Warning|Notice)\: Use of undefined constant SQLSRV_ENC_UNKNOWN - assumed \'SQLSRV_ENC_UNKNOWN\' (\(this will throw an Error in a future version of PHP\) )?in .+(\/|\\)sqlsrv_input_param_unknown_encoding\.php on line 33
Array
\(
\[0\] => Array
@ -81,4 +81,3 @@ Array
\)
\)