From 6d2182bc3c8c595fbccefcbbdce439928e993bf2 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Wed, 3 Aug 2022 18:47:55 -0700 Subject: [PATCH] Remove Statement::bindParam() --- UPGRADE.md | 7 +++ src/Driver/IBMDB2/Statement.php | 24 ++------- .../AbstractStatementMiddleware.php | 20 -------- src/Driver/Mysqli/Statement.php | 23 --------- src/Driver/OCI8/Statement.php | 30 ++---------- src/Driver/PDO/SQLSrv/Statement.php | 32 ++---------- src/Driver/PDO/Statement.php | 31 +----------- src/Driver/SQLSrv/Statement.php | 26 ---------- src/Driver/Statement.php | 34 ------------- src/Logging/Statement.php | 23 --------- src/Statement.php | 47 ------------------ tests/Functional/BlobTest.php | 4 +- tests/Functional/DataAccessTest.php | 28 ++--------- tests/Functional/StatementTest.php | 49 ------------------- tests/Logging/MiddlewareTest.php | 6 +-- tests/Portability/StatementTest.php | 14 ------ 16 files changed, 29 insertions(+), 369 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 85941476233..fb698888691 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -8,6 +8,13 @@ awareness about deprecated code. # Upgrade to 4.0 +## BC BREAK: removed wrapper- and driver-level `Statement::bindParam()` methods. + +The following methods have been removed: + +1. `Doctrine\DBAL\Statement::bindParam()`, +2. `Doctrine\DBAL\Driver\Statement::bindParam()`. + ## BC BREAK: made parameter type in driver-level `Statement::bind*()` methods required. The `$type` parameter of the driver-level `Statement::bindParam()` and `::bindValue()` has been made required. diff --git a/src/Driver/IBMDB2/Statement.php b/src/Driver/IBMDB2/Statement.php index fa447ac5a05..670d57cc2f3 100644 --- a/src/Driver/IBMDB2/Statement.php +++ b/src/Driver/IBMDB2/Statement.php @@ -10,7 +10,6 @@ use Doctrine\DBAL\Driver\IBMDB2\Exception\StatementError; use Doctrine\DBAL\Driver\Statement as StatementInterface; use Doctrine\DBAL\ParameterType; -use Doctrine\Deprecations\Deprecation; use function assert; use function db2_bind_param; @@ -55,34 +54,17 @@ public function bindValue(int|string $param, mixed $value, ParameterType $type): { assert(is_int($param)); - $this->bindParam($param, $value, $type); - } - - /** - * @deprecated Use {@see bindValue()} instead. - */ - public function bindParam(int|string $param, mixed &$variable, ParameterType $type, ?int $length = null): void - { - Deprecation::trigger( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5563', - '%s is deprecated. Use bindValue() instead.', - __METHOD__ - ); - - assert(is_int($param)); - switch ($type) { case ParameterType::INTEGER: - $this->bind($param, $variable, DB2_PARAM_IN, DB2_LONG); + $this->bind($param, $value, DB2_PARAM_IN, DB2_LONG); break; case ParameterType::LARGE_OBJECT: - $this->lobs[$param] = &$variable; + $this->lobs[$param] = &$value; break; default: - $this->bind($param, $variable, DB2_PARAM_IN, DB2_CHAR); + $this->bind($param, $value, DB2_PARAM_IN, DB2_CHAR); break; } } diff --git a/src/Driver/Middleware/AbstractStatementMiddleware.php b/src/Driver/Middleware/AbstractStatementMiddleware.php index be3be6edd9a..6eaad509fcd 100644 --- a/src/Driver/Middleware/AbstractStatementMiddleware.php +++ b/src/Driver/Middleware/AbstractStatementMiddleware.php @@ -7,7 +7,6 @@ use Doctrine\DBAL\Driver\Result; use Doctrine\DBAL\Driver\Statement; use Doctrine\DBAL\ParameterType; -use Doctrine\Deprecations\Deprecation; abstract class AbstractStatementMiddleware implements Statement { @@ -20,25 +19,6 @@ public function bindValue(int|string $param, mixed $value, ParameterType $type): $this->wrappedStatement->bindValue($param, $value, $type); } - /** - * @deprecated Use {@see bindValue()} instead. - */ - public function bindParam( - int|string $param, - mixed &$variable, - ParameterType $type, - ?int $length = null - ): void { - Deprecation::trigger( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5563', - '%s is deprecated. Use bindValue() instead.', - __METHOD__ - ); - - $this->wrappedStatement->bindParam($param, $variable, $type, $length); - } - public function execute(): Result { return $this->wrappedStatement->execute(); diff --git a/src/Driver/Mysqli/Statement.php b/src/Driver/Mysqli/Statement.php index 463d81770db..6861473e3fe 100644 --- a/src/Driver/Mysqli/Statement.php +++ b/src/Driver/Mysqli/Statement.php @@ -10,7 +10,6 @@ use Doctrine\DBAL\Driver\Mysqli\Exception\StatementError; use Doctrine\DBAL\Driver\Statement as StatementInterface; use Doctrine\DBAL\ParameterType; -use Doctrine\Deprecations\Deprecation; use mysqli_sql_exception; use mysqli_stmt; @@ -52,28 +51,6 @@ public function __construct(private readonly mysqli_stmt $stmt) $this->boundValues = array_fill(1, $paramCount, null); } - /** - * @deprecated Use {@see bindValue()} instead. - */ - public function bindParam( - int|string $param, - mixed &$variable, - ParameterType $type, - ?int $length = null - ): void { - Deprecation::trigger( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5563', - '%s is deprecated. Use bindValue() instead.', - __METHOD__ - ); - - assert(is_int($param)); - - $this->types[$param - 1] = $this->convertParameterType($type); - $this->boundValues[$param] =& $variable; - } - public function bindValue(int|string $param, mixed $value, ParameterType $type): void { assert(is_int($param)); diff --git a/src/Driver/OCI8/Statement.php b/src/Driver/OCI8/Statement.php index 8318a4b2944..f0f2f24abc1 100644 --- a/src/Driver/OCI8/Statement.php +++ b/src/Driver/OCI8/Statement.php @@ -8,7 +8,6 @@ use Doctrine\DBAL\Driver\OCI8\Exception\UnknownParameterIndex; use Doctrine\DBAL\Driver\Statement as StatementInterface; use Doctrine\DBAL\ParameterType; -use Doctrine\Deprecations\Deprecation; use function is_int; use function oci_bind_by_name; @@ -42,25 +41,6 @@ public function __construct( public function bindValue(int|string $param, mixed $value, ParameterType $type): void { - $this->bindParam($param, $value, $type); - } - - /** - * @deprecated Use {@see bindValue()} instead. - */ - public function bindParam( - int|string $param, - mixed &$variable, - ParameterType $type, - ?int $length = null - ): void { - Deprecation::trigger( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5563', - '%s is deprecated. Use bindValue() instead.', - __METHOD__ - ); - if (is_int($param)) { if (! isset($this->parameterMap[$param])) { throw UnknownParameterIndex::new($param); @@ -70,11 +50,11 @@ public function bindParam( } if ($type === ParameterType::LARGE_OBJECT) { - if ($variable !== null) { + if ($value !== null) { $lob = oci_new_descriptor($this->connection, OCI_D_LOB); - $lob->writeTemporary($variable, OCI_TEMP_BLOB); + $lob->writeTemporary($value, OCI_TEMP_BLOB); - $variable =& $lob; + $value =& $lob; } else { $type = ParameterType::STRING; } @@ -84,8 +64,8 @@ public function bindParam( ! @oci_bind_by_name( $this->statement, $param, - $variable, - $length ?? -1, + $value, + -1, $this->convertParameterType($type) ) ) { diff --git a/src/Driver/PDO/SQLSrv/Statement.php b/src/Driver/PDO/SQLSrv/Statement.php index 6889bb40699..651feaf4c9e 100644 --- a/src/Driver/PDO/SQLSrv/Statement.php +++ b/src/Driver/PDO/SQLSrv/Statement.php @@ -7,7 +7,6 @@ use Doctrine\DBAL\Driver\Middleware\AbstractStatementMiddleware; use Doctrine\DBAL\Driver\PDO\Statement as PDOStatement; use Doctrine\DBAL\ParameterType; -use Doctrine\Deprecations\Deprecation; use PDO; final class Statement extends AbstractStatementMiddleware @@ -24,30 +23,15 @@ public function __construct(PDOStatement $statement) $this->statement = $statement; } - /** - * @deprecated Use {@see bindValue()} instead. - */ - public function bindParam( - int|string $param, - mixed &$variable, - ParameterType $type, - ?int $length = null - ): void { - Deprecation::trigger( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5563', - '%s is deprecated. Use bindValue() instead.', - __METHOD__ - ); - + public function bindValue(int|string $param, mixed $value, ParameterType $type): void + { switch ($type) { case ParameterType::LARGE_OBJECT: case ParameterType::BINARY: $this->statement->bindParamWithDriverOptions( $param, - $variable, + $value, $type, - $length ?? 0, PDO::SQLSRV_ENCODING_BINARY ); break; @@ -55,20 +39,14 @@ public function bindParam( case ParameterType::ASCII: $this->statement->bindParamWithDriverOptions( $param, - $variable, + $value, ParameterType::STRING, - $length ?? 0, PDO::SQLSRV_ENCODING_SYSTEM ); break; default: - $this->statement->bindParam($param, $variable, $type, $length ?? 0); + $this->statement->bindValue($param, $value, $type); } } - - public function bindValue(int|string $param, mixed $value, ParameterType $type): void - { - $this->bindParam($param, $value, $type); - } } diff --git a/src/Driver/PDO/Statement.php b/src/Driver/PDO/Statement.php index 997c36ea450..fdd6d57839f 100644 --- a/src/Driver/PDO/Statement.php +++ b/src/Driver/PDO/Statement.php @@ -7,7 +7,6 @@ use Doctrine\DBAL\Driver\Exception as ExceptionInterface; use Doctrine\DBAL\Driver\Statement as StatementInterface; use Doctrine\DBAL\ParameterType; -use Doctrine\Deprecations\Deprecation; use PDO; use PDOException; use PDOStatement; @@ -32,33 +31,6 @@ public function bindValue(int|string $param, mixed $value, ParameterType $type): } } - /** - * @deprecated Use {@see bindValue()} instead. - */ - public function bindParam( - string|int $param, - mixed &$variable, - ParameterType $type, - ?int $length = null - ): void { - Deprecation::trigger( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5563', - '%s is deprecated. Use bindValue() instead.', - __METHOD__ - ); - - try { - if ($length === null) { - $this->stmt->bindParam($param, $variable, $this->convertParamType($type)); - } else { - $this->stmt->bindParam($param, $variable, $this->convertParamType($type), $length); - } - } catch (PDOException $exception) { - throw Exception::new($exception); - } - } - /** * @internal Driver options can be only specified by a PDO-based driver. * @@ -68,11 +40,10 @@ public function bindParamWithDriverOptions( string|int $param, mixed &$variable, ParameterType $type, - int $length, mixed $driverOptions ): void { try { - $this->stmt->bindParam($param, $variable, $this->convertParamType($type), $length, $driverOptions); + $this->stmt->bindParam($param, $variable, $this->convertParamType($type), 0, $driverOptions); } catch (PDOException $exception) { throw Exception::new($exception); } diff --git a/src/Driver/SQLSrv/Statement.php b/src/Driver/SQLSrv/Statement.php index 36ea291bcf9..4e0f367b66a 100644 --- a/src/Driver/SQLSrv/Statement.php +++ b/src/Driver/SQLSrv/Statement.php @@ -8,7 +8,6 @@ use Doctrine\DBAL\Driver\SQLSrv\Exception\Error; use Doctrine\DBAL\Driver\Statement as StatementInterface; use Doctrine\DBAL\ParameterType; -use Doctrine\Deprecations\Deprecation; use function assert; use function is_int; @@ -75,31 +74,6 @@ public function bindValue(int|string $param, mixed $value, ParameterType $type): $this->types[$param] = $type; } - /** - * @deprecated Use {@see bindValue()} instead. - */ - public function bindParam( - int|string $param, - mixed &$variable, - ParameterType $type, - ?int $length = null - ): void { - Deprecation::trigger( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5563', - '%s is deprecated. Use bindValue() instead.', - __METHOD__ - ); - - assert(is_int($param)); - - $this->variables[$param] =& $variable; - $this->types[$param] = $type; - - // unset the statement resource if it exists as the new one will need to be bound to the new variable - $this->stmt = null; - } - public function execute(): Result { $this->stmt ??= $this->prepare(); diff --git a/src/Driver/Statement.php b/src/Driver/Statement.php index ddabc82fccb..5f91b493711 100644 --- a/src/Driver/Statement.php +++ b/src/Driver/Statement.php @@ -30,40 +30,6 @@ interface Statement */ public function bindValue(int|string $param, mixed $value, ParameterType $type): void; - /** - * Binds a PHP variable to a corresponding named (not supported by mysqli driver, see comment below) or question - * mark placeholder in the SQL statement that was use to prepare the statement. Unlike {@see bindValue()}, - * the variable is bound as a reference and will only be evaluated at the time - * that PDOStatement->execute() is called. - * - * As mentioned above, the named parameters are not natively supported by the mysqli driver, use executeQuery(), - * fetchAll(), fetchArray(), fetchColumn(), fetchAssoc() methods to have the named parameter emulated by doctrine. - * - * Most parameters are input parameters, that is, parameters that are - * used in a read-only fashion to build up the query. Some drivers support the invocation - * of stored procedures that return data as output parameters, and some also as input/output - * parameters that both send in data and are updated to receive it. - * - * @deprecated Use {@see bindValue()} instead. - * - * @param int|string $param Parameter identifier. For a prepared statement using named placeholders, - * this will be a parameter name of the form :name. For a prepared statement using - * question mark placeholders, this will be the 1-indexed position of the parameter. - * @param mixed $variable The variable to bind to the parameter. - * @param ParameterType $type Explicit data type for the parameter using the {@see ParameterType} - * constants. - * @param int|null $length You must specify maxlength when using an OUT bind - * so that PHP allocates enough memory to hold the returned value. - * - * @throws Exception - */ - public function bindParam( - int|string $param, - mixed &$variable, - ParameterType $type, - ?int $length = null - ): void; - /** * Executes a prepared statement * diff --git a/src/Logging/Statement.php b/src/Logging/Statement.php index 0832bb0cacb..af8ef3a6b7d 100644 --- a/src/Logging/Statement.php +++ b/src/Logging/Statement.php @@ -8,7 +8,6 @@ use Doctrine\DBAL\Driver\Result as ResultInterface; use Doctrine\DBAL\Driver\Statement as StatementInterface; use Doctrine\DBAL\ParameterType; -use Doctrine\Deprecations\Deprecation; use Psr\Log\LoggerInterface; final class Statement extends AbstractStatementMiddleware @@ -30,28 +29,6 @@ public function __construct( parent::__construct($statement); } - /** - * @deprecated Use {@see bindValue()} instead. - */ - public function bindParam( - int|string $param, - mixed &$variable, - ParameterType $type, - ?int $length = null - ): void { - Deprecation::trigger( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5563', - '%s is deprecated. Use bindValue() instead.', - __METHOD__ - ); - - $this->params[$param] = &$variable; - $this->types[$param] = $type; - - parent::bindParam($param, $variable, $type, $length); - } - public function bindValue(int|string $param, mixed $value, ParameterType $type): void { $this->params[$param] = $value; diff --git a/src/Statement.php b/src/Statement.php index 2dd2ea62c90..163f0061f01 100644 --- a/src/Statement.php +++ b/src/Statement.php @@ -6,9 +6,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\Type; -use Doctrine\Deprecations\Deprecation; -use function func_num_args; use function is_string; /** @@ -98,51 +96,6 @@ public function bindValue( } } - /** - * Binds a parameter to a value by reference. - * - * Binding a parameter by reference does not support DBAL mapping types. - * - * @deprecated Use {@see bindValue()} instead. - * - * @param string|int $param Parameter identifier. For a prepared statement using named placeholders, - * this will be a parameter name of the form :name. For a prepared statement - * using question mark placeholders, this will be the 1-indexed position - * of the parameter. - * @param mixed $variable The variable to bind to the parameter. - * @param ParameterType $type The binding type. - * @param int|null $length Must be specified when using an OUT bind - * so that PHP allocates enough memory to hold the returned value. - * - * @throws Exception - */ - public function bindParam( - string|int $param, - mixed &$variable, - ParameterType $type = ParameterType::STRING, - ?int $length = null - ): void { - Deprecation::trigger( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5563', - '%s is deprecated. Use bindValue() instead.', - __METHOD__ - ); - - $this->params[$param] = $variable; - $this->types[$param] = $type; - - try { - if (func_num_args() > 3) { - $this->stmt->bindParam($param, $variable, $type, $length); - } else { - $this->stmt->bindParam($param, $variable, $type); - } - } catch (Driver\Exception $e) { - throw $this->conn->convertException($e); - } - } - /** * @throws Exception */ diff --git a/tests/Functional/BlobTest.php b/tests/Functional/BlobTest.php index 08f1b9395d9..917de4e0936 100644 --- a/tests/Functional/BlobTest.php +++ b/tests/Functional/BlobTest.php @@ -161,10 +161,8 @@ public function testBindParamProcessesStream(): void "INSERT INTO blob_table(id, clobcolumn, blobcolumn) VALUES (1, 'ignored', ?)" ); - $stmt->bindParam(1, $stream, ParameterType::LARGE_OBJECT); - - // Bind param does late binding (bind by reference), so create the stream only now: $stream = fopen('data://text/plain,test', 'r'); + $stmt->bindValue(1, $stream, ParameterType::LARGE_OBJECT); $stmt->executeStatement(); diff --git a/tests/Functional/DataAccessTest.php b/tests/Functional/DataAccessTest.php index a39a0393ccd..1d0b58e5c61 100644 --- a/tests/Functional/DataAccessTest.php +++ b/tests/Functional/DataAccessTest.php @@ -56,24 +56,6 @@ public function testPrepareWithBindValue(): void self::assertEquals(['test_int' => 1, 'test_string' => 'foo'], $row); } - public function testPrepareWithBindParam(): void - { - $paramInt = 1; - $paramStr = 'foo'; - - $sql = 'SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?'; - $stmt = $this->connection->prepare($sql); - - $stmt->bindParam(1, $paramInt); - $stmt->bindParam(2, $paramStr); - - $row = $stmt->executeQuery()->fetchAssociative(); - - self::assertIsArray($row); - $row = array_change_key_case($row, CASE_LOWER); - self::assertEquals(['test_int' => 1, 'test_string' => 'foo'], $row); - } - public function testPrepareWithFetchAllAssociative(): void { $paramInt = 1; @@ -82,8 +64,8 @@ public function testPrepareWithFetchAllAssociative(): void $sql = 'SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?'; $stmt = $this->connection->prepare($sql); - $stmt->bindParam(1, $paramInt); - $stmt->bindParam(2, $paramStr); + $stmt->bindValue(1, $paramInt); + $stmt->bindValue(2, $paramStr); $rows = $stmt->executeQuery()->fetchAllAssociative(); $rows[0] = array_change_key_case($rows[0], CASE_LOWER); @@ -98,8 +80,8 @@ public function testPrepareWithFetchOne(): void $sql = 'SELECT test_int FROM fetch_table WHERE test_int = ? AND test_string = ?'; $stmt = $this->connection->prepare($sql); - $stmt->bindParam(1, $paramInt); - $stmt->bindParam(2, $paramStr); + $stmt->bindValue(1, $paramInt); + $stmt->bindValue(2, $paramStr); $column = $stmt->executeQuery()->fetchOne(); self::assertEquals(1, $column); @@ -666,7 +648,7 @@ static function (int $interval): string { return '?'; }, static function (Statement $stmt, int $interval): void { - $stmt->bindParam(1, $interval, ParameterType::INTEGER); + $stmt->bindValue(1, $interval, ParameterType::INTEGER); }, ], 'literal' => [ diff --git a/tests/Functional/StatementTest.php b/tests/Functional/StatementTest.php index 77a326c66fb..547c36feb4a 100644 --- a/tests/Functional/StatementTest.php +++ b/tests/Functional/StatementTest.php @@ -182,25 +182,6 @@ public function testReuseStatementAfterFreeingResult(): void self::assertEquals(2, $id); } - public function testReuseStatementWithParameterBoundByReference(): void - { - $this->connection->insert('stmt_test', ['id' => 1]); - $this->connection->insert('stmt_test', ['id' => 2]); - - $stmt = $this->connection->prepare('SELECT id FROM stmt_test WHERE id = ?'); - $stmt->bindParam(1, $id); - - $id = 1; - - $result = $stmt->executeQuery(); - self::assertEquals(1, $result->fetchOne()); - - $id = 2; - - $result = $stmt->executeQuery(); - self::assertEquals(2, $result->fetchOne()); - } - public function testReuseStatementWithReboundValue(): void { $this->connection->insert('stmt_test', ['id' => 1]); @@ -217,36 +198,6 @@ public function testReuseStatementWithReboundValue(): void self::assertEquals(2, $result->fetchOne()); } - public function testReuseStatementWithReboundParam(): void - { - $this->connection->insert('stmt_test', ['id' => 1]); - $this->connection->insert('stmt_test', ['id' => 2]); - - $stmt = $this->connection->prepare('SELECT id FROM stmt_test WHERE id = ?'); - - $x = 1; - $stmt->bindParam(1, $x); - $result = $stmt->executeQuery(); - self::assertEquals(1, $result->fetchOne()); - - $y = 2; - $stmt->bindParam(1, $y); - $result = $stmt->executeQuery(); - self::assertEquals(2, $result->fetchOne()); - } - - public function testBindParamWithNullLength(): void - { - $this->connection->insert('stmt_test', ['id' => 1]); - - $stmt = $this->connection->prepare('SELECT id FROM stmt_test WHERE id = ?'); - - $value = 1; - $stmt->bindParam(1, $value, ParameterType::INTEGER, null); - - self::assertEquals(1, $stmt->executeQuery()->fetchOne()); - } - public function testBindInvalidNamedParameter(): void { if (TestUtil::isDriverOneOf('ibm_db2', 'mysqli', 'sqlsrv')) { diff --git a/tests/Logging/MiddlewareTest.php b/tests/Logging/MiddlewareTest.php index d4f3c5618aa..e7866341390 100644 --- a/tests/Logging/MiddlewareTest.php +++ b/tests/Logging/MiddlewareTest.php @@ -100,16 +100,14 @@ public function testExecuteStatementWithParameters(): void ->method('debug') ->with('Executing statement: {sql} (parameters: {params}, types: {types})', [ 'sql' => 'SELECT ?, ?', - 'params' => [1 => 42, 2 => 'Test'], - 'types' => [1 => ParameterType::INTEGER, 2 => ParameterType::STRING], + 'params' => [1 => 42], + 'types' => [1 => ParameterType::INTEGER], ]); $connection = $this->driver->connect([]); $statement = $connection->prepare('SELECT ?, ?'); $statement->bindValue(1, 42, ParameterType::INTEGER); - $statement->bindParam(2, $byRef, ParameterType::STRING); - $byRef = 'Test'; $statement->execute(); } diff --git a/tests/Portability/StatementTest.php b/tests/Portability/StatementTest.php index 9fd1a1e687a..e13176660dc 100644 --- a/tests/Portability/StatementTest.php +++ b/tests/Portability/StatementTest.php @@ -25,20 +25,6 @@ protected function setUp(): void $this->stmt = new Statement($this->wrappedStmt, $converter); } - public function testBindParam(): void - { - $column = 'mycolumn'; - $variable = 'myvalue'; - $type = ParameterType::STRING; - $length = 666; - - $this->wrappedStmt->expects(self::once()) - ->method('bindParam') - ->with($column, $variable, $type, $length); - - $this->stmt->bindParam($column, $variable, $type, $length); - } - public function testBindValue(): void { $param = 'myparam';