Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6009800
EchoHooksTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
EchoHooksTest.php
View Options
<?php
namespace
MediaWiki\Extension\Notifications\Test
;
use
MediaWiki\Extension\Notifications\Hooks
as
EchoHooks
;
use
MediaWiki\Extension\Notifications\Services
;
use
MediaWiki\MainConfigNames
;
use
MediaWikiIntegrationTestCase
;
class
EchoHooksTest
extends
MediaWikiIntegrationTestCase
{
/**
* @covers \MediaWiki\Extension\Notifications\Hooks::onUserGetDefaultOptions()
*/
public
function
testOnUserGetDefaultOptions
()
{
$this
->
overrideConfigValues
(
[
'EchoNotificationCategories'
=>
[
'emailuser'
=>
[
'priority'
=>
9
,
'tooltip'
=>
'echo-pref-tooltip-emailuser'
,
],
'mention'
=>
[
'priority'
=>
4
,
'tooltip'
=>
'echo-pref-tooltip-mention'
,
],
'system'
=>
[
'priority'
=>
9
,
'no-dismiss'
=>
[
'all'
],
],
'some-custom-category'
=>
[
'priority'
=>
9001
,
],
],
MainConfigNames
::
AllowHTMLEmail
=>
true
,
]
);
$defaults
=
[
'something'
=>
'unrelated'
,
// T174220: don't overwrite defaults set elsewhere
'echo-subscriptions-web-mention'
=>
false
,
];
$hooks
=
$this
->
getHooks
();
$hooks
->
onUserGetDefaultOptions
(
$defaults
);
self
::
assertEquals
(
[
'something'
=>
'unrelated'
,
'echo-email-format'
=>
'html'
,
'echo-subscriptions-email-mention'
=>
false
,
'echo-subscriptions-web-mention'
=>
false
,
'echo-subscriptions-email-emailuser'
=>
false
,
'echo-subscriptions-web-emailuser'
=>
true
,
'echo-subscriptions-email-system'
=>
true
,
'echo-subscriptions-web-system'
=>
true
,
'echo-subscriptions-email-some-custom-category'
=>
false
,
'echo-subscriptions-web-some-custom-category'
=>
true
,
],
$defaults
);
}
public
function
getHooks
()
{
$services
=
$this
->
getServiceContainer
();
$hooks
=
new
EchoHooks
(
$services
->
getAuthManager
(),
$services
->
getCentralIdLookup
(),
$services
->
getMainConfig
(),
Services
::
wrap
(
$services
)->
getAttributeManager
(),
$services
->
getHookContainer
(),
$services
->
getContentLanguage
(),
$services
->
getLinkRenderer
(),
$services
->
getNamespaceInfo
(),
$services
->
getPermissionManager
(),
$services
->
getRevisionStore
(),
$services
->
getStatsFactory
(),
$services
->
getTalkPageNotificationManager
(),
$services
->
getUserEditTracker
(),
$services
->
getUserFactory
(),
$services
->
getUserOptionsManager
(),
);
return
$hooks
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 4 2026, 09:31 (5 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
4e/bd/e5782fb9a92941ca36411196bbf1
Default Alt Text
EchoHooksTest.php (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment