From a5983ef546051e8d5388ad884ad44c9575b464af Mon Sep 17 00:00:00 2001 From: Hadis Kakanejadi Fard Date: Tue, 21 Feb 2017 16:54:47 -0800 Subject: [PATCH] added autonomous setup to test --- test/pdo_sqlsrv/pdo_270_fetch_binary.phpt | 31 +++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/test/pdo_sqlsrv/pdo_270_fetch_binary.phpt b/test/pdo_sqlsrv/pdo_270_fetch_binary.phpt index cfcff3871..ddb60fe93 100644 --- a/test/pdo_sqlsrv/pdo_270_fetch_binary.phpt +++ b/test/pdo_sqlsrv/pdo_270_fetch_binary.phpt @@ -1,24 +1,24 @@ --TEST-- -Test fetch from binary columns, without setting binary encoding. - ---DESCRIPTION-- +Test fetch from binary, varbinary, varbinary(max), image columns, without setting binary encoding. +--Description-- Verifies GitHub issue 270 is fixed, users could not retrieve the data as inserted in binary columns without setting the binary encoding either on stmt or using bindCoulmn encoding. This test versifies that the data inserted in binary columns can be retrieved using fetch, fetchColumn, fetchObject, and fetchALL functions. --FILE-- exec($sql); +// CREATE database +$conn->query("CREATE DATABASE ". $dbName) ?: die(); $sql = "CREATE TABLE $tableName ( $columns[0] binary(50), $columns[1] VARBINARY(50) ,$columns[2] VARBINARY(MAX), $columns[3] image)"; $conn->exec($sql); @@ -39,6 +39,12 @@ $stmt->execute(); foreach ($columns as $col){ test_fetch($conn, $tableName, $col, $icon); } +// DROP database +$conn->query("DROP DATABASE ". $dbName) ?: die(); + +//free connection +$conn=null; + print_r("Test finished successfully"); //calls various fetch methods @@ -86,9 +92,6 @@ function test_fetch($conn, $tableName, $columnName, $input){ } } - - - ?> --EXPECT-- Test finished successfully \ No newline at end of file