From 628122e1551d4dc90115427b643beab180c93b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Such=C3=A1nek?= Date: Fri, 20 Aug 2021 18:54:38 +0200 Subject: [PATCH] Fix camelCase of getUserEnabledEventsBySections Change-Id: I14b6750f7f3cc5334e3143f0e85ca033681b4e35 --- includes/AttributeManager.php | 2 +- includes/NotifUser.php | 4 ++-- includes/api/ApiEchoNotifications.php | 4 ++-- tests/phpunit/unit/AttributeManagerTest.php | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/includes/AttributeManager.php b/includes/AttributeManager.php index 9585d1a4d..80ef54a21 100644 --- a/includes/AttributeManager.php +++ b/includes/AttributeManager.php @@ -145,7 +145,7 @@ class EchoAttributeManager { * @param string[] $sections * @return string[] */ - public function getUserEnabledEventsbySections( + public function getUserEnabledEventsBySections( UserIdentity $userIdentity, $notifierTypes, array $sections diff --git a/includes/NotifUser.php b/includes/NotifUser.php index fddfccc2b..3611b4396 100644 --- a/includes/NotifUser.php +++ b/includes/NotifUser.php @@ -344,7 +344,7 @@ class MWEchoNotifUser { } $attributeManager = EchoServices::getInstance()->getAttributeManager(); - $eventTypes = $attributeManager->getUserEnabledEventsbySections( $this->mUser, 'web', $sections ); + $eventTypes = $attributeManager->getUserEnabledEventsBySections( $this->mUser, 'web', $sections ); $notifs = $this->notifMapper->fetchUnreadByUser( $this->mUser, $wgEchoMaxUpdateCount, null, $eventTypes ); @@ -562,7 +562,7 @@ class MWEchoNotifUser { $totals = [ 'count' => 0, 'timestamp' => -1 ]; foreach ( EchoAttributeManager::$sections as $section ) { - $eventTypesToLoad = $attributeManager->getUserEnabledEventsbySections( + $eventTypesToLoad = $attributeManager->getUserEnabledEventsBySections( $this->mUser, 'web', [ $section ] diff --git a/includes/api/ApiEchoNotifications.php b/includes/api/ApiEchoNotifications.php index 0a6d77708..81415c5b2 100644 --- a/includes/api/ApiEchoNotifications.php +++ b/includes/api/ApiEchoNotifications.php @@ -110,7 +110,7 @@ class ApiEchoNotifications extends ApiQueryBase { $attributeManager = EchoServices::getInstance()->getAttributeManager(); $result = $this->getPropList( $user, - $attributeManager->getUserEnabledEventsbySections( $user, $params['notifiertypes'], + $attributeManager->getUserEnabledEventsBySections( $user, $params['notifiertypes'], $params['sections'] ), $params['filter'], $params['limit'], $params['continue'], $params['format'], $titles, $params['unreadfirst'], $params['bundle'] @@ -174,7 +174,7 @@ class ApiEchoNotifications extends ApiQueryBase { array $notifierTypes = [ 'web' ] ) { $attributeManager = EchoServices::getInstance()->getAttributeManager(); - $sectionEvents = $attributeManager->getUserEnabledEventsbySections( $user, $notifierTypes, [ $section ] ); + $sectionEvents = $attributeManager->getUserEnabledEventsBySections( $user, $notifierTypes, [ $section ] ); if ( !$sectionEvents ) { $result = [ diff --git a/tests/phpunit/unit/AttributeManagerTest.php b/tests/phpunit/unit/AttributeManagerTest.php index abc359171..b04bbdf0f 100644 --- a/tests/phpunit/unit/AttributeManagerTest.php +++ b/tests/phpunit/unit/AttributeManagerTest.php @@ -320,7 +320,7 @@ class EchoAttributeManagerTest extends MediaWikiUnitTestCase { ); } - public function testGetUserEnabledEventsbySections() { + public function testGetUserEnabledEventsBySections() { $notif = [ 'event_one' => [ 'category' => 'category_one' @@ -371,25 +371,25 @@ class EchoAttributeManagerTest extends MediaWikiUnitTestCase { $notifyTypeAvailabilityByCategory ); $expected = [ 'event_one', 'event_three', 'event_four' ]; - $actual = $manager->getUserEnabledEventsbySections( $this->getUser(), 'web', [ 'alert' ] ); + $actual = $manager->getUserEnabledEventsBySections( $this->getUser(), 'web', [ 'alert' ] ); sort( $expected ); sort( $actual ); $this->assertEquals( $expected, $actual ); $expected = [ 'event_one', 'event_three', 'event_four', 'event_five' ]; - $actual = $manager->getUserEnabledEventsbySections( $this->getUser(), [ 'web', 'email' ], [ 'alert' ] ); + $actual = $manager->getUserEnabledEventsBySections( $this->getUser(), [ 'web', 'email' ], [ 'alert' ] ); sort( $expected ); sort( $actual ); $this->assertEquals( $expected, $actual ); $expected = [ 'event_two' ]; - $actual = $manager->getUserEnabledEventsbySections( $this->getUser(), 'web', [ 'message' ] ); + $actual = $manager->getUserEnabledEventsBySections( $this->getUser(), 'web', [ 'message' ] ); sort( $expected ); sort( $actual ); $this->assertEquals( $expected, $actual ); $expected = [ 'event_one', 'event_two', 'event_three', 'event_four' ]; - $actual = $manager->getUserEnabledEventsbySections( $this->getUser(), 'web', + $actual = $manager->getUserEnabledEventsBySections( $this->getUser(), 'web', [ 'message', 'alert' ] ); sort( $expected ); sort( $actual );