Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4095689
PageLangLogFormatterTest.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
PageLangLogFormatterTest.php
View Options
<?php
use
MediaWiki\MainConfigNames
;
use
MediaWiki\MainConfigSchema
;
/**
* @covers \PageLangLogFormatter
*/
class
PageLangLogFormatterTest
extends
LogFormatterTestCase
{
protected
function
setUp
():
void
{
parent
::
setUp
();
// Clear all hooks to disable cldr extension
$this
->
clearHooks
();
// Register LogHandler, see $wgPageLanguageUseDB in Setup.php
$this
->
overrideConfigValue
(
MainConfigNames
::
LogActionsHandlers
,
MainConfigSchema
::
getDefaultValue
(
MainConfigNames
::
LogActionsHandlers
)
+
[
'pagelang/pagelang'
=>
[
'class'
=>
PageLangLogFormatter
::
class
,
'services'
=>
[
'LanguageNameUtils'
,
]
]
]
);
}
/**
* Provide different rows from the logging table to test
* for backward compatibility.
* Do not change the existing data, just add a new database row
*/
public
static
function
providePageLangLogDatabaseRows
()
{
return
[
// Current format
[
[
'type'
=>
'pagelang'
,
'action'
=>
'pagelang'
,
'comment'
=>
'page lang comment'
,
'namespace'
=>
NS_MAIN
,
'title'
=>
'Page'
,
'params'
=>
[
'4::oldlanguage'
=>
'en'
,
'5::newlanguage'
=>
'de[def]'
,
],
],
[
'text'
=>
'User changed the language of Page from English (en) to Deutsch (de) [default]'
,
'api'
=>
[
'oldlanguage'
=>
'en'
,
'newlanguage'
=>
'de[def]'
],
],
],
];
}
/**
* @dataProvider providePageLangLogDatabaseRows
*/
public
function
testPageLangLogDatabaseRows
(
$row
,
$extra
)
{
$this
->
doTestLogFormatter
(
$row
,
$extra
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 14:00 (4 w, 4 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
2d/a2/f85c3186c1b478c22acfa2507033
Default Alt Text
PageLangLogFormatterTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment