From 592af4ce757ecaf62db7227d1ea6d25098051d72 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 3 Mar 2022 10:41:29 +0100 Subject: [PATCH] added failling PdoStatementObjectType test --- tests/default/data/pdo-stmt-obj-type.php | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/default/data/pdo-stmt-obj-type.php diff --git a/tests/default/data/pdo-stmt-obj-type.php b/tests/default/data/pdo-stmt-obj-type.php new file mode 100644 index 000000000..83025ed46 --- /dev/null +++ b/tests/default/data/pdo-stmt-obj-type.php @@ -0,0 +1,35 @@ +, 1: int<0, 4294967295>}> + */ + private function prepare(PDO $pdo): PDOStatement { + return $pdo->prepare('SELECT email, adaid FROM ada'); + } + + public function fetch(PDO $pdo) + { + $stmt = $this->prepare($pdo); + $stmt->execute(); + + assertType('PDOStatement, 1: int<0, 4294967295>}>', $stmt); + + $all = $stmt->fetch(PDO::FETCH_NUM); + assertType('array{string, int<0, 4294967295>}|false', $all); + + $all = $stmt->fetch(PDO::FETCH_ASSOC); + assertType('array{email: string, adaid: int<0, 4294967295>}|false', $all); + + $all = $stmt->fetch(PDO::FETCH_COLUMN); + assertType('string|false', $all); + } +}