From 2dd2d694caed3a0275db6ac916b89c045a2f5fdb Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 7 Jul 2012 15:05:42 +0200 Subject: [PATCH] Introduce StatementMock to make testsuite ready for upcoming DBAL change --- .../Tests/Mocks/DriverConnectionMock.php | 4 +-- tests/Doctrine/Tests/Mocks/StatementMock.php | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 tests/Doctrine/Tests/Mocks/StatementMock.php diff --git a/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php b/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php index 03d44caae..a18e24a4d 100644 --- a/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php +++ b/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php @@ -5,7 +5,7 @@ namespace Doctrine\Tests\Mocks; class DriverConnectionMock implements \Doctrine\DBAL\Driver\Connection { public function prepare($prepareString) {} - public function query() {} + public function query() { return new StatementMock; } public function quote($input, $type=\PDO::PARAM_STR) {} public function exec($statement) {} public function lastInsertId($name = null) {} @@ -14,4 +14,4 @@ class DriverConnectionMock implements \Doctrine\DBAL\Driver\Connection public function rollBack() {} public function errorCode() {} public function errorInfo() {} -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Mocks/StatementMock.php b/tests/Doctrine/Tests/Mocks/StatementMock.php new file mode 100644 index 000000000..2113cc48b --- /dev/null +++ b/tests/Doctrine/Tests/Mocks/StatementMock.php @@ -0,0 +1,25 @@ + + */ +class StatementMock implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement +{ + public function bindValue($param, $value, $type = null){} + public function bindParam($column, &$variable, $type = null){} + public function errorCode(){} + public function errorInfo(){} + public function execute($params = null){} + public function rowCount(){} + public function closeCursor(){} + public function columnCount(){} + public function setFetchMode($fetchStyle, $arg2 = null, $arg3 = null){} + public function fetch($fetchStyle = null){} + public function fetchAll($fetchStyle = null){} + public function fetchColumn($columnIndex = 0){} + public function getIterator(){} +}