Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4149365
CentralNoticeTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1003 B
Referenced Files
None
Subscribers
None
CentralNoticeTest.php
View Options
<?php
/**
* @group Fundraising
* @group Database
* @group CentralNotice
* @covers CentralNotice
*/
class
CentralNoticeTest
extends
PHPUnit\Framework\TestCase
{
public
function
testDropdownList
()
{
$text
=
'Weight'
;
$values
=
range
(
0
,
50
,
10
);
$this
->
assertEquals
(
"*Weight
\n
**0
\n
**10
\n
**20
\n
**30
\n
**40
\n
**50
\n
"
,
CentralNotice
::
dropdownList
(
$text
,
$values
)
);
}
public
static
function
provideSearchTerms
()
{
return
[
'empty'
=>
[
''
,
''
],
'whitespace normalization'
=>
[
"
\n\n
a
\t
b
\r
"
,
'a b'
],
'allowed characters'
=>
[
'a-to-z_A-to-Z_0-to-9'
,
'a-to-z_A-to-Z_0-to-9'
],
'bad characters are trimmed'
=>
[
'!("a")'
,
'a'
],
'bad characters cut off terms'
=>
[
'what:happens (??and??here??)'
,
'what and'
],
];
}
/**
* @dataProvider provideSearchTerms
*/
public
function
testSanitizeSearchTerms
(
string
$terms
,
string
$expected
)
{
$instance
=
new
CentralNotice
();
$this
->
assertSame
(
$expected
,
$instance
->
sanitizeSearchTerms
(
$terms
)
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 19 2026, 19:09 (6 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3b/38/9e360f93b96604d6e1afef1d0196
Default Alt Text
CentralNoticeTest.php (1003 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment