From a600f6b718ab81efeda1fce68e5f817c3f23504a Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 6 Nov 2014 15:49:16 +0100 Subject: try to fix delete older than threshold so we can test it properly --- tests/integration/db/ItemMapperTest.php | 34 ++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'tests/integration/db/ItemMapperTest.php') 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); } -- cgit v1.2.3