1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Introduce StatementMock to make testsuite ready for upcoming DBAL change

This commit is contained in:
Alexander 2012-07-07 15:05:42 +02:00
parent 0a95e42ea8
commit 2dd2d694ca
2 changed files with 27 additions and 2 deletions

View File

@ -5,7 +5,7 @@ namespace Doctrine\Tests\Mocks;
class DriverConnectionMock implements \Doctrine\DBAL\Driver\Connection class DriverConnectionMock implements \Doctrine\DBAL\Driver\Connection
{ {
public function prepare($prepareString) {} public function prepare($prepareString) {}
public function query() {} public function query() { return new StatementMock; }
public function quote($input, $type=\PDO::PARAM_STR) {} public function quote($input, $type=\PDO::PARAM_STR) {}
public function exec($statement) {} public function exec($statement) {}
public function lastInsertId($name = null) {} public function lastInsertId($name = null) {}

View File

@ -0,0 +1,25 @@
<?php
namespace Doctrine\Tests\Mocks;
/**
* This class is a mock of the Statement interface.
*
* @author Alexander <iam.asm89@gmail.com>
*/
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(){}
}