summaryrefslogtreecommitdiffstats
path: root/tests/integration/db/ItemMapperTest.php
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-11-06 15:49:16 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2014-11-06 15:49:16 +0100
commita600f6b718ab81efeda1fce68e5f817c3f23504a (patch)
treedc7521e1a9e9ee767602addef42e56d00861c6c1 /tests/integration/db/ItemMapperTest.php
parentdcf96e729991764e5dc5d5d9cc384540427dfdc4 (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.php34
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);
}