mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 01:30:15 +00:00
Move NotificationsTest to tests/phpunit
Under this folder the test is run automatically on CI or phpunit.php --testsuite extensions Change-Id: I5e466c04fc5c827883882f798ba0e41d6990e423
This commit is contained in:
parent
ee01b6db89
commit
43820a6390
|
@ -1009,7 +1009,7 @@
|
||||||
"MWEchoThankYouEditTest": "tests/phpunit/ThankYouEditTest.php",
|
"MWEchoThankYouEditTest": "tests/phpunit/ThankYouEditTest.php",
|
||||||
"NotificationControllerTest": "tests/phpunit/controller/NotificationControllerTest.php",
|
"NotificationControllerTest": "tests/phpunit/controller/NotificationControllerTest.php",
|
||||||
"NotificationPager": "includes/special/NotificationPager.php",
|
"NotificationPager": "includes/special/NotificationPager.php",
|
||||||
"NotificationsTest": "tests/NotificationsTest.php",
|
"NotificationsTest": "tests/phpunit/NotificationsTest.php",
|
||||||
"ProcessEchoEmailBatch": "maintenance/processEchoEmailBatch.php",
|
"ProcessEchoEmailBatch": "maintenance/processEchoEmailBatch.php",
|
||||||
"RemoveInvalidNotification": "maintenance/removeInvalidNotification.php",
|
"RemoveInvalidNotification": "maintenance/removeInvalidNotification.php",
|
||||||
"RemoveOrphanedEvents": "maintenance/removeOrphanedEvents.php",
|
"RemoveOrphanedEvents": "maintenance/removeOrphanedEvents.php",
|
||||||
|
|
|
@ -24,14 +24,15 @@ class NotificationsTest extends MediaWikiTestCase {
|
||||||
* @return EchoEvent
|
* @return EchoEvent
|
||||||
*/
|
*/
|
||||||
public static function getLatestNotification( $user ) {
|
public static function getLatestNotification( $user ) {
|
||||||
$notifs = ApiEchoNotifications::getNotifications( $user );
|
$notifMapper = new EchoNotificationMapper();
|
||||||
$index = array_keys( $notifs );
|
$notifs = $notifMapper->fetchUnreadByUser( $user, 1, '', [ 'user-rights' ] );
|
||||||
|
$notif = array_pop( $notifs );
|
||||||
|
|
||||||
return EchoEvent::newFromID( $notifs[$index[0]]['id'] );
|
return $notif->getEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers EchoHooks::onUserRights
|
* @covers EchoHooks::onUserGroupsChanged
|
||||||
*/
|
*/
|
||||||
public function testUserRightsNotif() {
|
public function testUserRightsNotif() {
|
||||||
$user = new User();
|
$user = new User();
|
Loading…
Reference in a new issue