mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-05 04:39:51 +00:00
34 lines
717 B
PHP
34 lines
717 B
PHP
|
<?php
|
||
|
|
||
|
class EchoHooksTest extends MediaWikiTestCase {
|
||
|
|
||
|
/**
|
||
|
* Test the UserSaveOptions hook implementation.
|
||
|
*/
|
||
|
public function testOnUserSaveOptions() {
|
||
|
$options['echo-notifications-blacklist'] = [
|
||
|
'',
|
||
|
'0',
|
||
|
'abcdef',
|
||
|
'12345',
|
||
|
'54321',
|
||
|
];
|
||
|
|
||
|
EchoHooks::onUserSaveOptions( new User(), $options );
|
||
|
|
||
|
$this->assertSame( "12345\n54321", $options['echo-notifications-blacklist'] );
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Test the UserLoadOptions hook implementation.
|
||
|
*/
|
||
|
public function testOnUserLoadOptions() {
|
||
|
$options['echo-notifications-blacklist'] = "12345\n54321";
|
||
|
|
||
|
EchoHooks::onUserLoadOptions( new User(), $options );
|
||
|
|
||
|
$this->assertSame( [ 12345, 54321 ], $options['echo-notifications-blacklist'] );
|
||
|
}
|
||
|
|
||
|
}
|