diff --git a/test/pdo_sqlsrv/pdo_utf8_stored_proc_surrogate.phpt b/test/pdo_sqlsrv/pdo_utf8_stored_proc_surrogate.phpt new file mode 100644 index 00000000..5f297a3f --- /dev/null +++ b/test/pdo_sqlsrv/pdo_utf8_stored_proc_surrogate.phpt @@ -0,0 +1,61 @@ +--TEST-- +call a stored procedure with NVARCHAR input to get output back as NVARCHAR +--SKIPIF-- + +--FILE-- +exec("CREATE PROC $procName (@p1 NVARCHAR(1000), @p2 NVARCHAR(1000) OUTPUT) + AS BEGIN SELECT @p2 = CONVERT(NVARCHAR(1000), @p1) END"); + + $stmt = $conn->prepare("{CALL $procName (?, ?)}"); + $stmt->bindValue(1, $inValue1); + $stmt->bindParam(2, $outValue1, PDO::PARAM_STR | PDO::PARAM_INPUT_OUTPUT, 1000); + $stmt->execute(); + + var_dump ($outValue1); + + $stmt = null; + $conn = null; +} + +function Repro() +{ + StartTest("pdo_utf8_stored_proc_surrogate"); + try + { + StoredProc_Surrogate(); + } + catch (Exception $e) + { + echo $e->getMessage(); + } + echo "\nDone\n"; + EndTest("pdo_utf8_stored_proc_surrogate"); +} + +Repro(); + +?> +--EXPECT-- + +...Starting 'pdo_utf8_stored_proc_surrogate' test... +string(304) "򔀀��􏺃�����􏰀���󒦃�𐀋𐀀𐊃���􏿿��𐀋𐆃�􏿿򔈀�𠏿�󒨀𠊃򔀋𐈀����􏰀􏶃�𐀀�󒪃􏶃�򔀀򔊃�𠀀󒨀�򔏿����􏶃���􏿿𐀀����􏿿�􏸀𐆃󒠀𐏿�����򔏿�𐆃�𠊃􏺃�􏰋" + +Done +...Test 'pdo_utf8_stored_proc_surrogate' completed successfully. + diff --git a/test/pdo_sqlsrv/pdo_utf8_stored_proc_unicode.phpt b/test/pdo_sqlsrv/pdo_utf8_stored_proc_unicode.phpt new file mode 100644 index 00000000..03587803 --- /dev/null +++ b/test/pdo_sqlsrv/pdo_utf8_stored_proc_unicode.phpt @@ -0,0 +1,61 @@ +--TEST-- +call a stored procedure with NVARCHAR input to get output back as NCHAR +--SKIPIF-- + +--FILE-- +exec("CREATE PROC $procName (@p1 NVARCHAR(MAX), @p2 NCHAR(1024) OUTPUT) + AS BEGIN SELECT @p2 = CONVERT(NCHAR(1024), @p1) END"); + + $stmt = $conn->prepare("{CALL $procName (?, ?)}"); + $stmt->bindValue(1, $inValue1); + $stmt->bindParam(2, $outValue1, PDO::PARAM_STR | PDO::PARAM_INPUT_OUTPUT, 1500); + $stmt->execute(); + + var_dump ($outValue1); + + $stmt = null; + $conn = null; +} + +function Repro() +{ + StartTest("pdo_utf8_stored_proc_unicode"); + try + { + StoredProc_Unicode(); + } + catch (Exception $e) + { + echo $e->getMessage(); + } + echo "\nDone\n"; + EndTest("pdo_utf8_stored_proc_unicode"); +} + +Repro(); + +?> +--EXPECT-- + +...Starting 'pdo_utf8_stored_proc_unicode' test... +string(1209) "验嗿ァチýІßІöÜハý衤öバäðª熇ð‍洐ıㅯタ鷗鷗לßÃگグ嗿ソグ倀чüゼㅯҐ熇チîゼ鷗‌ûi舳אґクЧ倀Ü曂ґÄýіポ衤îゼü衤タҐ‏ダİчåポソクÖグタöÖЧㅰハãªِчöûÄðÐяゾİゼІßハ侃ゼÄソלüßタゼ‍倀倁іÄההöяîöژ曂洐îゾگҐ " + +Done +...Test 'pdo_utf8_stored_proc_unicode' completed successfully. + diff --git a/test/pdo_sqlsrv/pdo_utf8_stored_proc_xml.phpt b/test/pdo_sqlsrv/pdo_utf8_stored_proc_xml.phpt new file mode 100644 index 00000000..172efb3e --- /dev/null +++ b/test/pdo_sqlsrv/pdo_utf8_stored_proc_xml.phpt @@ -0,0 +1,61 @@ +--TEST-- +call a stored procedure with XML input to get output back as characters +--SKIPIF-- + +--FILE-- +exec("CREATE PROC $procName (@p1 XML, @p2 CHAR(512) OUTPUT) + AS BEGIN SELECT @p2 = CONVERT(CHAR(512), @p1) END"); + + $stmt = $conn->prepare("{CALL $procName (?, ?)}"); + $stmt->bindValue(1, $inValue1); + $stmt->bindParam(2, $outValue1, PDO::PARAM_STR | PDO::PARAM_INPUT_OUTPUT, 512); + $stmt->execute(); + + var_dump($outValue1); + + $stmt = null; + $conn = null; +} + +function Repro() +{ + StartTest("pdo_utf8_stored_proc_xml"); + try + { + StoredProc_Xml(); + } + catch (Exception $e) + { + echo $e->getMessage(); + } + echo "\nDone\n"; + EndTest("pdo_utf8_stored_proc_xml"); +} + +Repro(); + +?> +--EXPECT-- + +...Starting 'pdo_utf8_stored_proc_xml' test... +string(516) "Je préfère l'été " + +Done +...Test 'pdo_utf8_stored_proc_xml' completed successfully. +