Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7446454
InsertableRegexValidatorTest.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
InsertableRegexValidatorTest.php
View Options
<?php
declare
(
strict_types
=
1
);
use
MediaWiki\Extension\Translate\Validation\Validators\InsertableRegexValidator
;
/**
* @license GPL-2.0-or-later
* @covers \MediaWiki\Extension\Translate\Validation\Validators\InsertableRegexValidator
*/
class
InsertableRegexValidatorTest
extends
BaseValidatorTestCase
{
/** @dataProvider provideTestCases */
public
function
test
(
$constructorParams
,
...
$params
)
{
$validator
=
new
InsertableRegexValidator
(
$constructorParams
);
$this
->
runValidatorTests
(
$validator
,
'variable'
,
...
$params
);
}
public
static
function
provideTestCases
()
{
yield
[
'/
\$
[a-z0-9]+/'
,
'$contacts is $diff less than that.'
,
'$contacts2 as $diff2 less.'
,
[
'missing'
,
'unknown'
],
'should correctly identifiy the missing and unknown parameters.'
];
yield
[
[
'regex'
=>
'/
\$
[a-z0-9]+/'
],
'$contacts is $diff less than that.'
,
'$contacts less.'
,
[
'missing'
],
'should correctly identifiy the missing parameters.'
];
yield
[
'/<[a-z]+>/'
,
'<hello> <world>'
,
'<hello> <world> <msg>'
,
[
'unknown'
],
'should correctly identify the unknown parameters.'
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 18:40 (1 d, 9 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
57/15/531cce1521b03e85fb2b0eaf9ff5
Default Alt Text
InsertableRegexValidatorTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment