From 57e61031877e1f921e7b4446471c61e4c5ac1b13 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 4 Apr 2014 03:09:17 +0200 Subject: register hooks for deleting feeds, folders and items if a user is deleted, fix #468 --- tests/unit/businesslayer/FeedBusinessLayerTest.php | 9 +++++++++ tests/unit/businesslayer/FolderBusinessLayerTest.php | 11 +++++++++++ tests/unit/businesslayer/ItemBusinessLayerTest.php | 12 ++++++++++++ 3 files changed, 32 insertions(+) (limited to 'tests/unit/businesslayer') diff --git a/tests/unit/businesslayer/FeedBusinessLayerTest.php b/tests/unit/businesslayer/FeedBusinessLayerTest.php index 357ee73eb..40b1fa883 100644 --- a/tests/unit/businesslayer/FeedBusinessLayerTest.php +++ b/tests/unit/businesslayer/FeedBusinessLayerTest.php @@ -733,5 +733,14 @@ class FeedBusinessLayerTest extends \OCA\AppFramework\Utility\TestUtility { } + public function testDeleteUser() { + $this->feedMapper->expects($this->once()) + ->method('deleteUser') + ->will($this->returnValue($this->user)); + + $this->feedBusinessLayer->deleteUser($this->user); + } + + } diff --git a/tests/unit/businesslayer/FolderBusinessLayerTest.php b/tests/unit/businesslayer/FolderBusinessLayerTest.php index 7f512920e..b473e5dea 100644 --- a/tests/unit/businesslayer/FolderBusinessLayerTest.php +++ b/tests/unit/businesslayer/FolderBusinessLayerTest.php @@ -285,4 +285,15 @@ class FolderBusinessLayerTest extends \OCA\AppFramework\Utility\TestUtility { $this->folderBusinessLayer->purgeDeleted($this->user, false); } + + + public function testDeleteUser() { + $this->folderMapper->expects($this->once()) + ->method('deleteUser') + ->will($this->returnValue($this->user)); + + $this->folderBusinessLayer->deleteUser($this->user); + } + + } diff --git a/tests/unit/businesslayer/ItemBusinessLayerTest.php b/tests/unit/businesslayer/ItemBusinessLayerTest.php index 5dc6c9895..c120b753d 100644 --- a/tests/unit/businesslayer/ItemBusinessLayerTest.php +++ b/tests/unit/businesslayer/ItemBusinessLayerTest.php @@ -360,6 +360,18 @@ class ItemBusinessLayerTest extends \OCA\AppFramework\Utility\TestUtility { $this->assertEquals($star, $result); } + + + public function testDeleteUser() { + $this->mapper->expects($this->once()) + ->method('deleteUser') + ->will($this->returnValue($this->user)); + + $this->itemBusinessLayer->deleteUser($this->user); + } + + + } -- cgit v1.2.3