diff --git a/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc b/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc index 62e06426e..ca99ae8b8 100644 --- a/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc +++ b/test/functional/pdo_sqlsrv/MsCommon_mid-refactor.inc @@ -169,7 +169,7 @@ class ColumnMeta public function isEncryptableType() { $unsupportedTypes = array("money", "smallmoney", "image", "ntext", "text", "xml", "sql_variant"); - if (in_array(strtolower($this->dataType), $unsupportedTypes) && !$this->forceEncrypt) { + if (!$this->forceEncrypt && in_array(strtolower($this->dataType), $unsupportedTypes)) { return false; } else { return true; diff --git a/test/functional/pdo_sqlsrv/pdo_ae_insert_money.phpt b/test/functional/pdo_sqlsrv/pdo_ae_insert_money.phpt index d11cf6b6e..638a55509 100644 --- a/test/functional/pdo_sqlsrv/pdo_ae_insert_money.phpt +++ b/test/functional/pdo_sqlsrv/pdo_ae_insert_money.phpt @@ -10,6 +10,7 @@ require_once("MsCommon_mid-refactor.inc"); require_once("AEData.inc"); $dataTypes = array("smallmoney", "money"); try { + //set to ERRMODE_SILENT to compare actual error and expected unsupport money types in encrypted columns error $conn = connect('', array(), PDO::ERRMODE_SILENT); foreach ($dataTypes as $dataType) { echo "\nTesting $dataType:\n"; diff --git a/test/functional/pdo_sqlsrv/pdo_ae_insert_pdoparam_money.phpt b/test/functional/pdo_sqlsrv/pdo_ae_insert_pdoparam_money.phpt index 71c505932..6d5cf8b85 100644 --- a/test/functional/pdo_sqlsrv/pdo_ae_insert_pdoparam_money.phpt +++ b/test/functional/pdo_sqlsrv/pdo_ae_insert_pdoparam_money.phpt @@ -10,6 +10,7 @@ require_once("MsCommon_mid-refactor.inc"); require_once("AEData.inc"); $dataTypes = array( "smallmoney", "money" ); try { + //set to ERRMODE_SILENT to compare actual error and expected unsupport money types in encrypted columns error $conn = connect('', array(), PDO::ERRMODE_SILENT); foreach ($dataTypes as $dataType) { echo "\nTesting $dataType:\n"; @@ -60,7 +61,7 @@ try { if ($success) { echo "Test successfully done.\n"; } - DropTable($conn, $tbname); + dropTable($conn, $tbname); } unset($stmt); unset($conn); diff --git a/test/functional/pdo_sqlsrv/pdo_ae_insert_retrieve.phpt b/test/functional/pdo_sqlsrv/pdo_ae_insert_retrieve.phpt index 4f464c9d2..d686e641e 100644 --- a/test/functional/pdo_sqlsrv/pdo_ae_insert_retrieve.phpt +++ b/test/functional/pdo_sqlsrv/pdo_ae_insert_retrieve.phpt @@ -11,11 +11,11 @@ try { $conn = connect(); // Create the table $tbname = 'Patients'; - $colMetaArr = array( new columnMeta("int", "PatientId", "IDENTITY(1,1)"), - new columnMeta("char(11)", "SSN"), - new columnMeta("nvarchar(50)", "FirstName", "NULL"), - new columnMeta("nvarchar(50)", "LastName", "NULL"), - new columnMeta("date", "BirthDate", null, "randomized")); + $colMetaArr = array( new ColumnMeta("int", "PatientId", "IDENTITY(1,1)"), + new ColumnMeta("char(11)", "SSN"), + new ColumnMeta("nvarchar(50)", "FirstName", "NULL"), + new ColumnMeta("nvarchar(50)", "LastName", "NULL"), + new ColumnMeta("date", "BirthDate", null, "randomized")); createTable($conn, $tbname, $colMetaArr); // insert a row diff --git a/test/functional/pdo_sqlsrv/pdo_ae_insert_retrieve_nvarchar.phpt b/test/functional/pdo_sqlsrv/pdo_ae_insert_retrieve_nvarchar.phpt index 92f03f887..4566014a2 100644 --- a/test/functional/pdo_sqlsrv/pdo_ae_insert_retrieve_nvarchar.phpt +++ b/test/functional/pdo_sqlsrv/pdo_ae_insert_retrieve_nvarchar.phpt @@ -38,7 +38,7 @@ if (isColEncrypted()) { $conn1 = connect('', array(), PDO::ERRMODE_EXCEPTION, true); $stmt = $conn1->query($selectSql); while ($decrypted_row = $stmt->fetch(PDO::FETCH_ASSOC)) { - if ($decrypted_row[ 'CharCount' ] == strlen($decrypted_row[getDefaultColName("nvarchar(1000)")])) { + if ($decrypted_row['CharCount'] == strlen($decrypted_row[getDefaultColName("nvarchar(1000)")])) { $rowInd = $decrypted_row[ 'CharCount' ] + 1; echo "Failed to encrypted at row $rowInd\n"; $testPass = false; diff --git a/test/functional/pdo_sqlsrv/pdo_ae_insert_string.phpt b/test/functional/pdo_sqlsrv/pdo_ae_insert_string.phpt index e9f295bca..6793b6c65 100644 --- a/test/functional/pdo_sqlsrv/pdo_ae_insert_string.phpt +++ b/test/functional/pdo_sqlsrv/pdo_ae_insert_string.phpt @@ -16,7 +16,7 @@ try { // create table $tbname = getTableName(); - $colMetaArr = array( new columnMeta($dataType, "c_det"), new columnMeta($dataType, "c_rand", null, "randomized")); + $colMetaArr = array(new ColumnMeta($dataType, "c_det"), new ColumnMeta($dataType, "c_rand", null, "randomized")); createTable($conn, $tbname, $colMetaArr); // insert a row