$notification = \OC::$server->getNotificationManager()->createNotification();
$notification->setUser($this->uid);
\OC::$server->getNotificationManager()->markProcessed($notification);
- }
- if ($this->emitter) {
- $this->emitter->emit('\OC\User', 'postDelete', array($this));
+ if ($this->emitter) {
+ $this->emitter->emit('\OC\User', 'postDelete', array($this));
+ }
}
return !($result === false);
}
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;
$this->restoreService('CommentsManager');
$this->restoreService('NotificationManager');
- $this->assertEquals(2, $hooksCalled);
+ $this->assertEquals($expectedHooks, $hooksCalled);
}
public function testGetCloudId() {