Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7468425
GettextNewlineValidatorTest.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
GettextNewlineValidatorTest.php
View Options
<?php
declare
(
strict_types
=
1
);
use
MediaWiki\Extension\Translate\Validation\Validators\GettextNewlineValidator
;
/**
* @license GPL-2.0-or-later
* @covers \MediaWiki\Extension\Translate\Validation\Validators\GettextNewlineValidator
*/
class
GettextNewlineValidatorTest
extends
BaseValidatorTestCase
{
/** @dataProvider provideTestCases */
public
function
test
(
...
$params
)
{
$this
->
runValidatorTests
(
new
GettextNewlineValidator
(),
'newline'
,
...
$params
);
}
public
static
function
provideTestCases
()
{
yield
[
"
\n\n
Hello
\n\n\\
"
,
"
\n
Hello World
\n\n\n\\
"
,
[
'missing-start'
,
'extra-end'
],
'should see a notice due to missing / extra newlines.'
,
];
yield
[
"
\n
Hello
\n\\
"
,
"
\n
Hello World
\n\\
"
,
[],
'should not see a notice when newlines are matching.'
,
];
yield
[
"
\n\n
Hello"
,
"
\n
Hello World"
,
[
'missing-start'
],
'should see a notice due to missing / extra newlines.'
,
];
yield
[
"Hello"
,
"Hello World
\n\\
"
,
[
'extra-end'
],
'should see a notice due to missing / extra newlines.'
,
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 23, 06:34 (3 d, 14 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
4f/5c/ff65a1857cc8bd42760832578755
Default Alt Text
GettextNewlineValidatorTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment