Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6025608
NotificationStructureTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
NotificationStructureTest.php
View Options
<?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'
];
$callable
=
reset
(
$locators
);
if
(
is_array
(
$callable
)
)
{
$callable
=
reset
(
$callable
);
}
self
::
assertTrue
(
is_callable
(
$callable
),
'User locator '
.
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
Details
Attached
Mime Type
text/x-php
Expires
Oct 4 2026, 16:24 (5 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
9d/47/ee8e48070bf0142bf248d5c7b6e8
Default Alt Text
NotificationStructureTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment