Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F2751915
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
Fri, Jul 3, 19:19 (1 d, 12 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
81/07/09f73170b618ec29185539948be9
Default Alt Text
CentralNoticeTest.php (1003 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment