Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7451909
NotEmptyValidatorTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
963 B
Referenced Files
None
Subscribers
None
NotEmptyValidatorTest.php
View Options
<?php
declare
(
strict_types
=
1
);
use
MediaWiki\Extension\Translate\Validation\Validators\NotEmptyValidator
;
/**
* @license GPL-2.0-or-later
* @covers \MediaWiki\Extension\Translate\Validation\Validators\NotEmptyValidator
*/
class
NotEmptyValidatorTest
extends
BaseValidatorTestCase
{
/** @dataProvider provideTestCases */
public
function
test
(
...
$params
)
{
$this
->
runValidatorTests
(
new
NotEmptyValidator
(),
'empty'
,
...
$params
);
}
public
static
function
provideTestCases
()
{
yield
[
'Hello'
,
''
,
[
'empty'
],
'should see a notice when an empty translation is provided.'
,
];
yield
[
'Hello'
,
"
\n
"
,
[
'empty'
],
'should see a notice when a translation with newlines is provided.'
,
];
yield
[
'Hello'
,
'Hello World'
,
[],
'should not see a notice when translation is not an empty string.'
,
];
yield
[
'Hello'
,
null
,
[],
'should not see a notice when translation is null.'
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 21:50 (2 d, 4 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
51/58/c43fb3d20f8a4b9077f3a22e8ebb
Default Alt Text
NotEmptyValidatorTest.php (963 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment