Skip to content

Commit cbe8452

Browse files
staabmclxmstaab
andauthored
Added branches tests (#12)
Co-authored-by: Markus Staab <[email protected]>
1 parent 98f895a commit cbe8452

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/data/pdo.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ public function replaceQuery(PDO $pdo)
105105
assertType('PDOStatement', $stmt);
106106
}
107107

108+
public function queryBranches(PDO $pdo, bool $bool, int $adaid)
109+
{
110+
$query = 'SELECT email, adaid FROM ada';
111+
$stmt = $pdo->query($query, PDO::FETCH_NUM);
112+
assertType('PDOStatement<array{string, int<0, 4294967295>}>', $stmt);
113+
114+
if ($bool) {
115+
$query .= ' WHERE adaid='.$adaid;
116+
}
117+
118+
$stmt = $pdo->query($query, PDO::FETCH_NUM);
119+
assertType('PDOStatement<array{string, int<0, 4294967295>}>', $stmt);
120+
}
121+
108122
public function updateQuery(PDO $pdo)
109123
{
110124
$query = "UPDATE ada SET email='[email protected]' where adaid=-5";

0 commit comments

Comments
 (0)