added tests for invalid connection option and invalid transaction isolation value

This commit is contained in:
v-kaywon 2017-04-03 14:42:53 -07:00
parent 6dbc588bc7
commit 2c9a4b67d8
2 changed files with 38 additions and 2 deletions

View file

@ -0,0 +1,37 @@
--TEST--
Test PDO::__Construct connection option TransactionIsolation with invalid value
--SKIPIF--
--FILE--
<?php
function Connect($value) {
require("autonomous_setup.php");
$database = "tempdb";
$dsn = "sqlsrv:Server = $serverName;" .
"Database = $database;" .
"TransactionIsolation = $value";
$conn = new PDO( $dsn, $username, $password );
$conn = NULL;
}
// TEST BEGIN
try {
Connect("INVALID_KEY");
echo "Test Successful";
}
catch( PDOException $e ) {
var_dump( $e->errorInfo );
}
?>
--EXPECT--
array(3) {
[0]=>
string(5) "IMSSP"
[1]=>
int(-63)
[2]=>
string(88) "An invalid value was specified for the keyword 'TransactionIsolation' in the DSN string."
}

View file

@ -1,5 +1,5 @@
--TEST--
Test PDO::__Construct by passing connection options
Test PDO::__Construct with invalid connection option
--SKIPIF--
--FILE--
@ -21,7 +21,6 @@ try
}
catch( PDOException $e ) {
var_dump( $e->errorInfo );
exit;
}
?>