Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/default/data/pdo-mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,21 @@ public function aggregateFunctions(PDO $pdo)
$stmt = $pdo->query($query, PDO::FETCH_ASSOC);
assertType('PDOStatement<array{MAX(adaid): int<-32768, 32767>|null, MIN(adaid): int<-32768, 32767>|null, COUNT(adaid): int, AVG(adaid): float|null}>', $stmt);
}

public function placeholderInData(PDO $pdo)
{
// double quotes within the query
$query = 'SELECT adaid FROM ada WHERE email LIKE ":gesperrt%"';
$stmt = $pdo->prepare($query);
assertType('PDOStatement<array{adaid: int<-32768, 32767>, 0: int<-32768, 32767>}>', $stmt);
$stmt->execute();
assertType('PDOStatement<array{adaid: int<-32768, 32767>, 0: int<-32768, 32767>}>', $stmt);

// single quotes within the query
$query = "SELECT adaid FROM ada WHERE email LIKE ':gesperrt%'";
$stmt = $pdo->prepare($query);
assertType('PDOStatement<array{adaid: int<-32768, 32767>, 0: int<-32768, 32767>}>', $stmt);
$stmt->execute();
assertType('PDOStatement<array{adaid: int<-32768, 32767>, 0: int<-32768, 32767>}>', $stmt);
}
}
12 changes: 0 additions & 12 deletions tests/default/data/pdo-prepare.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,6 @@ public function placeholderInData(PDO $pdo)
assertType('PDOStatement<array{adaid: int<-32768, 32767>, 0: int<-32768, 32767>}>', $stmt);
$stmt->execute();
assertType('PDOStatement<array{adaid: int<-32768, 32767>, 0: int<-32768, 32767>}>', $stmt);

$query = 'SELECT adaid FROM ada WHERE email LIKE ":gesperrt%"';
$stmt = $pdo->prepare($query);
assertType('PDOStatement<array{adaid: int<-32768, 32767>, 0: int<-32768, 32767>}>', $stmt);
$stmt->execute();
assertType('PDOStatement<array{adaid: int<-32768, 32767>, 0: int<-32768, 32767>}>', $stmt);

$query = "SELECT adaid FROM ada WHERE email LIKE ':gesperrt%'";
$stmt = $pdo->prepare($query);
assertType('PDOStatement<array{adaid: int<-32768, 32767>, 0: int<-32768, 32767>}>', $stmt);
$stmt->execute();
assertType('PDOStatement<array{adaid: int<-32768, 32767>, 0: int<-32768, 32767>}>', $stmt);
}

public function arrayParam(PDO $pdo)
Expand Down