Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5978126
PreferencesIntegrationTest.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
PreferencesIntegrationTest.php
View Options
<?php
namespace
MediaWiki\Extension\Math\Tests
;
use
MediaWiki\Context\RequestContext
;
use
MediaWiki\Title\Title
;
use
MediaWikiIntegrationTestCase
;
/**
* @covers \MediaWiki\Extension\Math\HookHandlers\PreferencesHooksHandler
* @group Database
*/
class
PreferencesIntegrationTest
extends
MediaWikiIntegrationTestCase
{
public
function
testInvalidDefaultOptionFixed
()
{
$this
->
mergeMwGlobalArrayValue
(
'wgDefaultUserOptions'
,
[
'math'
=>
'garbage'
]
);
$this
->
assertContains
(
$this
->
getServiceContainer
()->
getUserOptionsLookup
()->
getDefaultOption
(
'math'
),
$this
->
getServiceContainer
()->
get
(
'Math.Config'
)->
getValidRenderingModes
()
);
}
public
function
testMathOptionRegistered
()
{
$context
=
new
RequestContext
();
$context
->
setTitle
(
Title
::
makeTitle
(
NS_MAIN
,
'Dummy'
)
);
$allPreferences
=
$this
->
getServiceContainer
()
->
getPreferencesFactory
()
->
getFormDescriptor
(
$this
->
getTestUser
()->
getUser
(),
$context
);
$this
->
assertArrayHasKey
(
'math'
,
$allPreferences
);
$mathPrefs
=
$allPreferences
[
'math'
];
$this
->
assertSame
(
'radio'
,
$mathPrefs
[
'type'
]
);
$this
->
assertSame
(
$this
->
getServiceContainer
()->
getUserOptionsLookup
()->
getDefaultOption
(
'math'
),
$mathPrefs
[
'default'
]
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 20:15 (3 d, 13 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ce/a8/a53a58a8de4075a414cd91fe30b5
Default Alt Text
PreferencesIntegrationTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment