summaryrefslogtreecommitdiffstats
path: root/tests/lib/User
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-09-29 15:05:47 +0200
committerJoas Schilling <coding@schilljs.com>2016-09-29 15:40:53 +0200
commit4d1acfd4ef7087b8dc7795396c75fd239a6245f4 (patch)
tree8b51beb4ea63495900ed844bab0e529ec493cc09 /tests/lib/User
parentf6ff60f4cb3800e5e7937fc18d62b99342fb7727 (diff)
downloadnextcloud-server-4d1acfd4ef7087b8dc7795396c75fd239a6245f4.tar.gz
nextcloud-server-4d1acfd4ef7087b8dc7795396c75fd239a6245f4.zip
Only trigger postDelete hooks when the user was deleted...
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib/User')
-rw-r--r--tests/lib/User/UserTest.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/lib/User/UserTest.php b/tests/lib/User/UserTest.php
index 19afa3642dd..5eee5d60d04 100644
--- a/tests/lib/User/UserTest.php
+++ b/tests/lib/User/UserTest.php
@@ -435,16 +435,17 @@ class UserTest extends \Test\TestCase {
public function dataDeleteHooks() {
return [
- [true],
- [false],
+ [true, 2],
+ [false, 1],
];
}
/**
* @dataProvider dataDeleteHooks
* @param bool $result
+ * @param int $expectedHooks
*/
- public function testDeleteHooks($result) {
+ public function testDeleteHooks($result, $expectedHooks) {
$hooksCalled = 0;
$test = $this;
@@ -521,7 +522,7 @@ class UserTest extends \Test\TestCase {
$this->restoreService('CommentsManager');
$this->restoreService('NotificationManager');
- $this->assertEquals(2, $hooksCalled);
+ $this->assertEquals($expectedHooks, $hooksCalled);
}
public function testGetCloudId() {