Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7445655
NewlineValidatorTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
988 B
Referenced Files
None
Subscribers
None
NewlineValidatorTest.php
View Options
<?php
declare
(
strict_types
=
1
);
use
MediaWiki\Extension\Translate\Validation\Validators\NewlineValidator
;
/**
* @license GPL-2.0-or-later
* @covers \MediaWiki\Extension\Translate\Validation\Validators\NewlineValidator
*/
class
NewlineValidatorTest
extends
BaseValidatorTestCase
{
/** @dataProvider provideTestCases */
public
function
test
(
...
$params
)
{
$this
->
runValidatorTests
(
new
NewlineValidator
(),
'newline'
,
...
$params
);
}
public
static
function
provideTestCases
()
{
yield
[
'Hello'
,
'Hello World'
,
[],
'should not see a notice when newlines are not present.'
,
];
yield
[
"
\n
Hello"
,
"
\n
Hello World"
,
[],
'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 starting newlines.'
,
];
yield
[
"Hello"
,
"
\n
Hello World"
,
[
'extra-start'
],
'should see a notice due to extra starting newlines.'
,
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 18:14 (1 d, 7 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
c4/d2/22f5796a15070ae82c6ac3749097
Default Alt Text
NewlineValidatorTest.php (988 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment