Page MenuHomeWickedGov Phorge

NotificationStructureTest.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

NotificationStructureTest.php

<?php
namespace MediaWiki\Extension\Notifications\Test;
use MediaWikiIntegrationTestCase;
class NotificationStructureTest extends MediaWikiIntegrationTestCase {
/**
* @coversNothing
* @dataProvider provideNotificationTypes
*
* @param string $type
* @param array $info
*/
public function testNotificationTypes( $type, array $info ) {
if ( isset( $info['presentation-model'] ) ) {
self::assertTrue( class_exists( $info['presentation-model'] ),
"Presentation model class {$info['presentation-model']} for {$type} must exist"
);
}
if ( isset( $info['user-locators'] ) ) {
$locators = (array)$info['user-locators'];
foreach ( $locators as $i => $callable ) {
if ( is_array( $callable ) ) {
$callable = reset( $callable );
}
self::assertTrue( is_callable( $callable ),
"User locator #$i " . print_r( $callable, true ) . " for {$type} must be callable"
);
}
}
}
public static function provideNotificationTypes() {
global $wgEchoNotifications;
$result = [];
foreach ( $wgEchoNotifications as $type => $info ) {
$result[] = [ $type, $info ];
}
return $result;
}
}

File Metadata

Mime Type
text/x-php
Expires
Aug 14 2026, 19:16 (13 w, 10 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3b/79/b54520819134b4fe23ba382d5ea1
Default Alt Text
NotificationStructureTest.php (1 KB)

Event Timeline