diff --git a/tests/Doctrine/Tests/DBAL/Functional/Driver/OCI8/StatementTest.php b/tests/Doctrine/Tests/DBAL/Functional/Driver/OCI8/StatementTest.php index e29d76468a2..59848b01fc9 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Driver/OCI8/StatementTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Driver/OCI8/StatementTest.php @@ -40,15 +40,29 @@ public function testQueryConversion(string $query, array $params, array $expecte } /** + * Low-level approach to working with parameter binding + * * @param mixed[] $params * @param mixed[] $expected * * @dataProvider queryConversionProvider */ - public function testQueryPrepare(string $query, array $params, array $expected) : void + public function testStatementBindParameters(string $query, array $params, array $expected) : void { $stmt = $this->connection->prepare($query); - $stmt->execute($params); + $hasZeroIndex = array_key_exists(0, $params); + + foreach ($params as $key => $val) { + if ($hasZeroIndex && is_int($key)) { + $param = $key + 1; + } else { + $param = $key; + } + + $stmt->bindParam($param, $val); + } + + $stmt->execute(); self::assertEquals( $expected, @@ -62,7 +76,7 @@ public function testQueryPrepare(string $query, array $params, array $expected) public static function queryConversionProvider() : iterable { return [ - 'simple' => [ + 'positional' => [ 'SELECT ? COL1 FROM DUAL', [1], ['COL1' => 1],