mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
56dfaea949
Bug: T315938 Change-Id: I4d061216da8a492fd0d28518d55e67f92e38ee78
56 lines
1.4 KiB
PHP
56 lines
1.4 KiB
PHP
<?php
|
|
|
|
use MediaWiki\Extension\Notifications\Hooks as EchoHooks;
|
|
|
|
class EchoHooksTest extends MediaWikiIntegrationTestCase {
|
|
/**
|
|
* @covers \MediaWiki\Extension\Notifications\Hooks::onUserGetDefaultOptions()
|
|
*/
|
|
public function testOnUserGetDefaultOptions() {
|
|
$this->setMwGlobals( [
|
|
'wgEchoNotificationCategories' => [
|
|
'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,
|
|
],
|
|
],
|
|
'wgAllowHTMLEmail' => true,
|
|
] );
|
|
|
|
$defaults = [
|
|
'something' => 'unrelated',
|
|
// T174220: don't overwrite defaults set elsewhere
|
|
'echo-subscriptions-web-mention' => false,
|
|
];
|
|
( new EchoHooks( new HashConfig ) )->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
|
|
);
|
|
}
|
|
}
|