Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7403413
CIDRCalculatorResultBoxTest.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
CIDRCalculatorResultBoxTest.php
View Options
<?php
namespace
MediaWiki\CheckUser\Tests\Unit\CheckUser\Widgets
;
use
MediaWiki\CheckUser\CheckUser\Widgets\CIDRCalculatorResultBox
;
use
MediaWikiUnitTestCase
;
use
Wikimedia\TestingAccessWrapper
;
/**
* @group CheckUser
* @covers \MediaWiki\CheckUser\CheckUser\Widgets\CIDRCalculatorResultBox
*/
class
CIDRCalculatorResultBoxTest
extends
MediaWikiUnitTestCase
{
/** @dataProvider provideIsAlwaysDisabled */
public
function
testIsAlwaysDisabled
(
$config
)
{
$resultBox
=
TestingAccessWrapper
::
newFromObject
(
new
CIDRCalculatorResultBox
(
$config
)
);
$this
->
assertSame
(
'disabled'
,
$resultBox
->
input
->
getAttribute
(
'disabled'
),
'The input should always have the disabled attribute set.'
);
}
public
static
function
provideIsAlwaysDisabled
()
{
return
[
'Disabled is not set in the caller
\'
s config'
=>
[
[]
],
'Disabled is set in the caller
\'
s config'
=>
[
[
'disabled'
=>
true
]
]
];
}
public
function
testSetDisabled
()
{
$resultBox
=
TestingAccessWrapper
::
newFromObject
(
new
CIDRCalculatorResultBox
(
[]
)
);
$this
->
assertSame
(
$resultBox
->
object
,
$resultBox
->
setDisabled
(
false
),
'setDisabled should return the result box object'
);
$this
->
assertSame
(
'disabled'
,
$resultBox
->
input
->
getAttribute
(
'disabled'
),
'The input should not have been un-disabled by the setDisabled call.'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 21, 18:37 (2 d, 9 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
42/0f/8661f4c56a456756485f053e2737
Default Alt Text
CIDRCalculatorResultBoxTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment