Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6053452
CentralNoticeTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1004 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
Oct 5 2026, 00:00 (5 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d6/8b/712cf56b4542c33415d67be1aad2
Default Alt Text
CentralNoticeTest.php (1004 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment