Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/quota_warning.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-09-03 15:14:59 +0300
committerJoas Schilling <coding@schilljs.com>2019-09-03 15:16:21 +0300
commitf63ecc3e786fd66c087223a0089df2b3d5e6e414 (patch)
treed0f5b420217035c1a868c0ca21932ca149ccb235
parent1fd874851abc05bd3dd6b0800a6aaad59be618bf (diff)
Move to AlreadyProcessedExceptionv1.6.0
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/Notification/Notifier.php3
-rw-r--r--tests/Notification/NotifierTest.php3
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php
index 742d846..7edadb7 100644
--- a/lib/Notification/Notifier.php
+++ b/lib/Notification/Notifier.php
@@ -29,6 +29,7 @@ use OCA\QuotaWarning\CheckQuota;
use OCP\IConfig;
use OCP\IURLGenerator;
use OCP\L10N\IFactory;
+use OCP\Notification\AlreadyProcessedException;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
@@ -94,7 +95,7 @@ class Notifier implements INotifier {
$usage = $this->checkQuota->getRelativeQuotaUsage($notification->getUser());
if ($usage < $this->config->getAppValue('quota_warning', 'info_percentage', 85)) {
// User is not in danger zone anymore
- throw new \InvalidArgumentException('Less usage');
+ throw new AlreadyProcessedException();
}
if ($usage > $this->config->getAppValue('quota_warning', 'alert_percentage', 95)) {
diff --git a/tests/Notification/NotifierTest.php b/tests/Notification/NotifierTest.php
index b1b7b10..ec6abf3 100644
--- a/tests/Notification/NotifierTest.php
+++ b/tests/Notification/NotifierTest.php
@@ -90,8 +90,7 @@ class NotifierTest extends \Test\TestCase {
}
/**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Less usage
+ * @expectedException \OCP\Notification\AlreadyProcessedException
*/
public function testPrepareLessUsage() {
/** @var INotification|\PHPUnit_Framework_MockObject_MockObject $notification */