Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7448049
UnicodePluralValidatorTest.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
UnicodePluralValidatorTest.php
View Options
<?php
declare
(
strict_types
=
1
);
use
MediaWiki\Extension\Translate\Validation\Validators\UnicodePluralValidator
;
/**
* @license GPL-2.0-or-later
* @covers \MediaWiki\Extension\Translate\Validation\Validators\UnicodePluralValidator
*/
class
UnicodePluralValidatorTest
extends
BaseValidatorTestCase
{
/** @dataProvider provideTestCases */
public
function
test
(
...
$params
)
{
$this
->
runValidatorTests
(
new
UnicodePluralValidator
(),
'plural'
,
...
$params
);
}
public
static
function
provideTestCases
()
{
yield
[
'{{PLURAL|one=a|b}}'
,
'a'
,
[
'missing'
],
'Missing plural is an issue'
];
yield
[
'a'
,
'{{PLURAL|one=a|b}}'
,
[
'unsupported'
],
'Plural in an unsupported message is an issue'
];
yield
[
'{{PLURAL|one=a|b}}'
,
'{{PLURAL|one=aa|bb}}'
,
[],
'Correct plural syntax is not an issue'
];
yield
[
'{{PLURAL|one=a|b}}'
,
'{{PLURAL|one=a|two=b|c}}'
,
[
'forms'
],
'Extra plural forms are an issue'
];
yield
[
'{{PLURAL|one=a|b}}'
,
'{{PLURAL|one=a|two=b|c}}'
,
[],
'Extra plural forms are not an issue for languages without plural rules'
,
'x-unknown'
];
yield
[
'{{PLURAL|one=a|b}}'
,
'{{PLURAL|tuuli=a|b}}'
,
[
'forms'
],
'Unknown plural forms are an issue even for languages without plural rules'
,
'x-unknown'
];
yield
[
'{{PLURAL|one=a|b}}'
,
'{{PLURAL|a}}'
,
[],
'Fewer plural forms are not an issue for languages without plural rules'
,
'x-unknown'
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 19:28 (1 d, 11 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
4e/4c/ea757474c04b54f57a4057bde6b7
Default Alt Text
UnicodePluralValidatorTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment