2017-05-04 02:09:36 +02:00
|
|
|
--TEST--
|
|
|
|
functions return FALSE for errors.
|
|
|
|
--SKIPIF--
|
|
|
|
<?php require('skipif.inc'); ?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
2017-10-04 23:22:56 +02:00
|
|
|
sqlsrv_configure('WarningsReturnAsErrors', 0);
|
|
|
|
sqlsrv_configure('LogSeverity', SQLSRV_LOG_SEVERITY_ALL);
|
2017-05-04 02:09:36 +02:00
|
|
|
|
2017-10-04 23:22:56 +02:00
|
|
|
require_once('MsSetup.inc');
|
2017-05-04 02:09:36 +02:00
|
|
|
|
2017-10-04 23:22:56 +02:00
|
|
|
$conn = sqlsrv_connect("_!@)(#");
|
|
|
|
if ($conn !== false) {
|
|
|
|
fatalError("sqlsrv_connect should have returned false.");
|
2017-05-04 02:09:36 +02:00
|
|
|
}
|
2017-10-04 23:22:56 +02:00
|
|
|
|
2020-04-15 22:49:52 +02:00
|
|
|
$conn = sqlsrv_connect("_!@#$", array( "Driver" => "Wrong Driver" ));
|
2017-10-04 23:22:56 +02:00
|
|
|
if ($conn !== false) {
|
|
|
|
fatalError("sqlsrv_connect should have returned false.");
|
2017-05-04 02:09:36 +02:00
|
|
|
}
|
2017-10-04 23:22:56 +02:00
|
|
|
|
|
|
|
$conn = sqlsrv_connect($server, array( "uid" => $uid , "pwd" => $pwd ));
|
|
|
|
|
|
|
|
if ($conn === false) {
|
|
|
|
fatalError("sqlsrv_connect should have connected.");
|
2017-05-04 02:09:36 +02:00
|
|
|
}
|
2017-10-04 23:22:56 +02:00
|
|
|
|
|
|
|
$stmt = sqlsrv_query($conn, "SELECT * FROM some_bogus_table");
|
|
|
|
if ($stmt !== false) {
|
|
|
|
fatalError("sqlsrv_query should have returned false.");
|
2017-05-04 02:09:36 +02:00
|
|
|
}
|
2017-10-04 23:22:56 +02:00
|
|
|
|
2017-05-04 02:09:36 +02:00
|
|
|
echo "Test successful.\n";
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
|
|
|
Test successful.
|