From dcf96e729991764e5dc5d5d9cc384540427dfdc4 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 6 Nov 2014 14:45:14 +0100 Subject: more integration tests --- tests/integration/db/ItemMapperTest.php | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'tests/integration/db/ItemMapperTest.php') diff --git a/tests/integration/db/ItemMapperTest.php b/tests/integration/db/ItemMapperTest.php index dcc27ab98..c86112d46 100644 --- a/tests/integration/db/ItemMapperTest.php +++ b/tests/integration/db/ItemMapperTest.php @@ -28,4 +28,40 @@ class ItemMapperTest extends NewsIntegrationTest { $this->assertEquals('Döner', $fetched->getBody()); } + + /** + * @expectedException OCP\AppFramework\Db\DoesNotExistException + */ + public function testFindNotFoundWhenDeletedFeed() { + $id = $this->items['not found feed']->getId(); + $this->itemMapper->find($id, $this->userId); + } + + + /** + * @expectedException OCP\AppFramework\Db\DoesNotExistException + */ + public function testFindNotFoundWhenDeletedFolder() { + $id = $this->items['not found folder']->getId(); + $this->itemMapper->find($id, $this->userId); + } + + + public function testDeleteOlderThanThreshold() { + $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); + } + + } \ No newline at end of file -- cgit v1.2.3