add test for invalid connection option
This commit is contained in:
parent
3fc7d81205
commit
6dbc588bc7
37
test/pdo_sqlsrv/pdo_invalide_conn_opt.phpt
Normal file
37
test/pdo_sqlsrv/pdo_invalide_conn_opt.phpt
Normal file
|
@ -0,0 +1,37 @@
|
|||
--TEST--
|
||||
Test PDO::__Construct by passing connection options
|
||||
--SKIPIF--
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once("autonomous_setup.php");
|
||||
|
||||
try
|
||||
{
|
||||
$database = "tempdb";
|
||||
$dsn = "sqlsrv:Server = $serverName;" .
|
||||
"Database = $database;" .
|
||||
"InvalidKey = true;"
|
||||
;
|
||||
$conn = new PDO( $dsn, $username, $password);
|
||||
|
||||
|
||||
echo "Test Successful";
|
||||
}
|
||||
catch( PDOException $e ) {
|
||||
var_dump( $e->errorInfo );
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
--EXPECT--
|
||||
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(5) "IMSSP"
|
||||
[1]=>
|
||||
int(-42)
|
||||
[2]=>
|
||||
string(64) "An invalid keyword 'InvalidKey' was specified in the DSN string."
|
||||
}
|
Loading…
Reference in a new issue