зеркало из https://github.com/microsoft/msphpsql.git
added tests for invalid connection option and invalid transaction isolation value
This commit is contained in:
Родитель
6dbc588bc7
Коммит
2c9a4b67d8
|
@ -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."
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
?>
|
||||
|
Загрузка…
Ссылка в новой задаче