mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 17:20:40 +00:00
Fix camelCase of getUserEnabledEventsBySections
Change-Id: I14b6750f7f3cc5334e3143f0e85ca033681b4e35
This commit is contained in:
parent
31a5ab4e7b
commit
628122e155
|
@ -145,7 +145,7 @@ class EchoAttributeManager {
|
|||
* @param string[] $sections
|
||||
* @return string[]
|
||||
*/
|
||||
public function getUserEnabledEventsbySections(
|
||||
public function getUserEnabledEventsBySections(
|
||||
UserIdentity $userIdentity,
|
||||
$notifierTypes,
|
||||
array $sections
|
||||
|
|
|
@ -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 ]
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue