diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-04 17:32:57 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-04 17:33:08 +0200 |
commit | 2879f07476bb8a81f5316c8ea95d0b536fdf97ea (patch) | |
tree | ce2eb7ed56d7c8e44ddc68cc7aa2840999a0df8a /tests/unit/db/postgres | |
parent | 1b2595ec13966c2a7a236eb1823d72aaaa72dfeb (diff) |
depend on oc6, bind correct types, fix #457
Diffstat (limited to 'tests/unit/db/postgres')
-rw-r--r-- | tests/unit/db/postgres/ItemMapperTest.php | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/tests/unit/db/postgres/ItemMapperTest.php b/tests/unit/db/postgres/ItemMapperTest.php index 0dad0471a..1e3207387 100644 --- a/tests/unit/db/postgres/ItemMapperTest.php +++ b/tests/unit/db/postgres/ItemMapperTest.php @@ -157,38 +157,8 @@ class ItemMapperTest extends \OCA\AppFramework\Utility\MapperTestUtility { $params2 = array($status, 30, 1); - $pdoResult = $this->getMock('Result', - array('fetchRow')); - - $pdoResult->expects($this->at(0)) - ->method('fetchRow') - ->will($this->returnValue($row)); - $pdoResult->expects($this->at(1)) - ->method('fetchRow') - ->will($this->returnValue(false)); - - $query = $this->getMock('Query', - array('execute')); - $query->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($params1)) - ->will($this->returnValue($pdoResult)); - - $this->api->expects($this->at(0)) - ->method('prepareQuery') - ->with($this->equalTo($sql1)) - ->will(($this->returnValue($query))); - - $query2 = $this->getMock('Query', - array('execute')); - $query2->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($params2)); - - $this->api->expects($this->at(1)) - ->method('prepareQuery') - ->with($this->equalTo($sql2)) - ->will($this->returnValue($query2)); + $this->setMapperResult($sql1, $params1, array($row)); + $this->setMapperResult($sql2, $params2); $result = $this->mapper->deleteReadOlderThanThreshold($threshold); } |