diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-06 15:49:16 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-06 15:49:16 +0100 |
commit | a600f6b718ab81efeda1fce68e5f817c3f23504a (patch) | |
tree | dc7521e1a9e9ee767602addef42e56d00861c6c1 /tests/integration/db/ItemMapperTest.php | |
parent | dcf96e729991764e5dc5d5d9cc384540427dfdc4 (diff) |
try to fix delete older than threshold so we can test it properly
Diffstat (limited to 'tests/integration/db/ItemMapperTest.php')
-rw-r--r-- | tests/integration/db/ItemMapperTest.php | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/tests/integration/db/ItemMapperTest.php b/tests/integration/db/ItemMapperTest.php index c86112d46..5e6452398 100644 --- a/tests/integration/db/ItemMapperTest.php +++ b/tests/integration/db/ItemMapperTest.php @@ -47,20 +47,28 @@ class ItemMapperTest extends NewsIntegrationTest { } - public function testDeleteOlderThanThreshold() { + private function deleteReadOlderThanThreshold() { $this->itemMapper->deleteReadOlderThanThreshold(1); - $item1 = $this->items['del1']; - $item2 = $this->items['del2']; - $item3 = $this->items['del3']; - $item4 = $this->items['del4']; - - $this->itemMapper->find($item3->getId(), $this->userId); - $this->itemMapper->find($item4->getId(), $this->userId); - - //$this->setExpectedException( - // 'OCP\AppFramework\Db\DoesNotExistException'); - $this->itemMapper->find($item1->getId(), $this->userId); - $this->itemMapper->find($item2->getId(), $this->userId); + + $this->itemMapper->find($this->items['del3']->getId(), $this->userId); + $this->itemMapper->find($this->items['del4']->getId(), $this->userId); + } + + + public function testDeleteOlderThanThresholdOne() { + $this->deleteReadOlderThanThreshold(); + + $this->setExpectedException( + 'OCP\AppFramework\Db\DoesNotExistException'); + $this->itemMapper->find($this->items['del1']->getId(), $this->userId); + } + + + public function testDeleteOlderThanThresholdTwo() { + $this->deleteReadOlderThanThreshold(); + $this->setExpectedException( + 'OCP\AppFramework\Db\DoesNotExistException'); + $this->itemMapper->find($this->items['del2']->getId(), $this->userId); } |