php-sqlsrv/test/functional/pdo_sqlsrv/pdo_utf8_conn.phpt

30 lines
1,002 B
Plaintext
Raw Normal View History

2017-05-03 22:09:02 +02:00
--TEST--
UTF-8 connection strings
--SKIPIF--
<?php require('skipif_mid-refactor.inc'); ?>
2017-05-03 22:09:02 +02:00
--FILE--
<?php
require_once("MsSetup.inc");
2017-11-02 18:33:18 +01:00
require_once("MsCommon_mid-refactor.inc");
2017-05-03 22:09:02 +02:00
$server = 'localhost';
$databaseName = 'test';
$uid = 'sa';
$pwd = 'Sunshine4u';
2017-05-03 22:09:02 +02:00
$dsn = getDSN($server, $databaseName, $driver);
// test an invalid connection credentials
$c = new PDO($dsn, $uid, $pwd);
2017-05-03 22:09:02 +02:00
if ($c !== false) {
die("Should have failed to connect.");
}
2017-05-03 22:09:02 +02:00
?>
--EXPECTREGEX--
2018-04-05 21:53:18 +02:00
Fatal error: Uncaught PDOException: SQLSTATE\[(28000|08001|HYT00)\]: .*\[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\](\[SQL Server\])?(Named Pipes Provider: Could not open a connection to SQL Server \[2\]\. |TCP Provider: Error code (0x2726|0x2AF9)|Login timeout expired|Login failed for user 'sa'\.) in .+(\/|\\)pdo_utf8_conn\.php:[0-9]+
2017-05-03 22:09:02 +02:00
Stack trace:
#0 .+(\/|\\)pdo_utf8_conn\.php\([0-9]+\): PDO->__construct(\(\)|\('sqlsrv:Server=l\.\.\.', 'sa', 'Sunshine4u'\))
2017-05-03 22:09:02 +02:00
#1 {main}
thrown in .+(\/|\\)pdo_utf8_conn\.php on line [0-9]+