summaryrefslogtreecommitdiffstats
path: root/tests/unit/businesslayer
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-05-21 21:10:45 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-05-21 21:10:45 +0200
commit031ba0ce524f35c70b776173917ae4ce3819951e (patch)
treea54c45c0e9b9412ae7970034e7621115dce714c8 /tests/unit/businesslayer
parent284d428111d03c16561c15dc98daaab802d2cac4 (diff)
When creating a feed or folder the it should purge the deleted
Edit fix #176
Diffstat (limited to 'tests/unit/businesslayer')
-rw-r--r--tests/unit/businesslayer/FeedBusinessLayerTest.php20
-rw-r--r--tests/unit/businesslayer/FolderBusinessLayerTest.php21
2 files changed, 41 insertions, 0 deletions
diff --git a/tests/unit/businesslayer/FeedBusinessLayerTest.php b/tests/unit/businesslayer/FeedBusinessLayerTest.php
index 882106693..9f8683d9b 100644
--- a/tests/unit/businesslayer/FeedBusinessLayerTest.php
+++ b/tests/unit/businesslayer/FeedBusinessLayerTest.php
@@ -740,4 +740,24 @@ class FeedBusinessLayerTest extends \OCA\AppFramework\Utility\TestUtility {
}
+ public function testPurgeDeletedWithoutInterval(){
+ $feed1 = new Feed();
+ $feed1->setId(3);
+ $feed2 = new Feed();
+ $feed2->setId(5);
+ $feeds = array($feed1, $feed2);
+
+ $this->feedMapper->expects($this->once())
+ ->method('getToDelete')
+ ->with($this->equalTo(null), $this->equalTo($this->user))
+ ->will($this->returnValue($feeds));
+ $this->feedMapper->expects($this->at(1))
+ ->method('delete')
+ ->with($this->equalTo($feed1));
+ $this->feedMapper->expects($this->at(2))
+ ->method('delete')
+ ->with($this->equalTo($feed2));
+
+ $this->feedBusinessLayer->purgeDeleted($this->user, false);
+ }
}
diff --git a/tests/unit/businesslayer/FolderBusinessLayerTest.php b/tests/unit/businesslayer/FolderBusinessLayerTest.php
index 1e26f0226..35886b626 100644
--- a/tests/unit/businesslayer/FolderBusinessLayerTest.php
+++ b/tests/unit/businesslayer/FolderBusinessLayerTest.php
@@ -232,4 +232,25 @@ class FolderBusinessLayerTest extends \OCA\AppFramework\Utility\TestUtility {
$this->folderBusinessLayer->purgeDeleted($this->user);
}
+
+ public function testPurgeDeletedNoInterval(){
+ $folder1 = new Folder();
+ $folder1->setId(3);
+ $folder2 = new Folder();
+ $folder2->setId(5);
+ $feeds = array($folder1, $folder2);
+
+ $this->folderMapper->expects($this->once())
+ ->method('getToDelete')
+ ->with($this->equalTo(null), $this->equalTo($this->user))
+ ->will($this->returnValue($feeds));
+ $this->folderMapper->expects($this->at(1))
+ ->method('delete')
+ ->with($this->equalTo($folder1));
+ $this->folderMapper->expects($this->at(2))
+ ->method('delete')
+ ->with($this->equalTo($folder2));
+
+ $this->folderBusinessLayer->purgeDeleted($this->user, false);
+ }
}