Skip to content

Commit

Permalink
Fixed a flawed emulate prepare test with AE (#1301)
Browse files Browse the repository at this point in the history
  • Loading branch information
yitam committed Sep 15, 2021
1 parent 4af55d5 commit 48b6a60
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions test/functional/pdo_sqlsrv/pdo_prepare_emulatePrepare_unicode.phpt
Expand Up @@ -47,17 +47,21 @@ try {
print_r($row);

//with emulate prepare and no bind param options
print_r("Prepare with emulate prepare and no bindParam options:\n");
if (!isAEConnected()) {
$options = array(PDO::ATTR_EMULATE_PREPARES => true);
} else {
$options = array(PDO::ATTR_EMULATE_PREPARES => false);
}
$stmt = prepareStmt($conn, $query, $options);
$row = $stmt->fetch(PDO::FETCH_ASSOC);
print_r($row);
if ($stmt->rowCount() == 0) {
print_r("No results for this query\n");

print_r("Prepare with emulate prepare and no bindParam options:\n");
// This test only makes sense without AE because the default encoding is PDO::SQLSRV_ENCODING_UTF8
if (!isAEConnected()) {
$stmt = prepareStmt($conn, $query, $options);
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if ($stmt->rowCount() != 0) {
print_r("Do not expect results for this query!\n");
print_r($row);
}
}

//with emulate prepare and SQLSRV_ENCODING_UTF8
Expand Down Expand Up @@ -117,7 +121,6 @@ Array
[age] => 30
)
Prepare with emulate prepare and no bindParam options:
No results for this query
Prepare with emulate prepare and SQLSRV_ENCODING_UTF8:
Array
(
Expand Down

0 comments on commit 48b6a60

Please sign in to comment.