php-sqlsrv/test/functional/sqlsrv/TC78_RegressionVSTS611146.phpt

56 lines
1.3 KiB
Plaintext
Raw Normal View History

2017-05-04 01:00:31 +02:00
--TEST--
Data Roundtrip via Stored Proc
--DESCRIPTION--
Verifies that data is not corrupted through a roundtrip via a store procedure.
Checks all character data types.
--ENV--
PHPT_EXEC=true
--SKIPIF--
2017-10-27 18:32:57 +02:00
<?php require('skipif_versions_old.inc'); ?>
2017-05-04 01:00:31 +02:00
--FILE--
<?php
require_once('MsCommon.inc');
2017-05-04 01:00:31 +02:00
function bugRepro()
2017-05-04 01:00:31 +02:00
{
$testName = "Regression VSTS 611146";
startTest($testName);
2017-05-04 01:00:31 +02:00
setup();
$conn1 = AE\connect();
2017-05-04 01:00:31 +02:00
// empty parameter array
$s = sqlsrv_query($conn1, "select ?", array( array() ));
if ($s !== false) {
die("Should have failed.");
} else {
2017-05-04 01:00:31 +02:00
$arr = sqlsrv_errors();
print_r($arr[0][2]);
print_r("\n");
2017-05-04 01:00:31 +02:00
}
// unknown direction
$s = sqlsrv_query($conn1, "select ?", array( array( 1, 1000 ) ));
if ($s !== false) {
die("Should have failed.");
} else {
2017-05-04 01:00:31 +02:00
$arr = sqlsrv_errors();
print_r($arr[0][2]);
print_r("\n");
2017-05-04 01:00:31 +02:00
}
endTest($testName);
2017-05-04 01:00:31 +02:00
}
try {
bugRepro();
} catch (Exception $e) {
echo $e->getMessage();
2017-05-04 01:00:31 +02:00
}
?>
--EXPECT--
Parameter array 1 must have at least one value or variable.
An invalid direction for parameter 1 was specified. SQLSRV_PARAM_IN, SQLSRV_PARAM_OUT, and SQLSRV_PARAM_INOUT are valid values.
Test "Regression VSTS 611146" completed successfully.