mediawiki-extensions-Echo/tests/phpunit/HooksTest.php
Kunal Mehta 59a125fc38 Add @covers tags
Change-Id: Ib8cf432b58470c9218519639379c83254acef1c8
2018-01-23 16:44:45 -08:00

37 lines
746 B
PHP

<?php
/**
* @covers EchoHooks
*/
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'] );
}
}