diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-29 19:16:28 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-29 19:16:28 +0100 |
commit | 37e8969d347b4a277a0a9c5bb963ff9f2ec1b6ae (patch) | |
tree | dc25fc539bfef9518d12f13ad974b4a6414838d0 /tests | |
parent | 55142186deb9e163ce3519453ebfe93f6a446666 (diff) | |
download | nextcloud-server-37e8969d347b4a277a0a9c5bb963ff9f2ec1b6ae.tar.gz nextcloud-server-37e8969d347b4a277a0a9c5bb963ff9f2ec1b6ae.zip |
ignore cursorclosing
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/appframework/db/mappertestutility.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/lib/appframework/db/mappertestutility.php b/tests/lib/appframework/db/mappertestutility.php index ad7a67a96b1..3508286137d 100644 --- a/tests/lib/appframework/db/mappertestutility.php +++ b/tests/lib/appframework/db/mappertestutility.php @@ -36,7 +36,7 @@ abstract class MapperTestUtility extends \Test\TestCase { private $prepareAt; private $fetchAt; private $iterators; - + /** * Run this function before the actual test to either set or initialize the @@ -51,7 +51,7 @@ abstract class MapperTestUtility extends \Test\TestCase { ->getMock(); $this->query = $this->getMock('Query', array('execute', 'bindValue')); - $this->pdoResult = $this->getMock('Result', array('fetch')); + $this->pdoResult = $this->getMock('Result', array('fetch', 'closeCursor')); $this->queryAt = 0; $this->prepareAt = 0; $this->iterators = array(); @@ -90,7 +90,8 @@ abstract class MapperTestUtility extends \Test\TestCase { return $result; } )); - + $this->pdoResult->expects($this->any()) + ->method('closeCursor'); $index = 1; foreach($arguments as $argument) { switch (gettype($argument)) { @@ -105,7 +106,7 @@ abstract class MapperTestUtility extends \Test\TestCase { case 'boolean': $pdoConstant = \PDO::PARAM_BOOL; break; - + default: $pdoConstant = \PDO::PARAM_STR; break; @@ -138,14 +139,14 @@ abstract class MapperTestUtility extends \Test\TestCase { } elseif($limit === null && $offset !== null) { $this->db->expects($this->at($this->prepareAt)) ->method('prepareQuery') - ->with($this->equalTo($sql), + ->with($this->equalTo($sql), $this->equalTo(null), $this->equalTo($offset)) ->will(($this->returnValue($this->query))); } else { $this->db->expects($this->at($this->prepareAt)) ->method('prepareQuery') - ->with($this->equalTo($sql), + ->with($this->equalTo($sql), $this->equalTo($limit), $this->equalTo($offset)) ->will(($this->returnValue($this->query))); @@ -162,11 +163,11 @@ abstract class MapperTestUtility extends \Test\TestCase { class ArgumentIterator { private $arguments; - + public function __construct($arguments){ $this->arguments = $arguments; } - + public function next(){ $result = array_shift($this->arguments); if($result === null){ |