Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7433753
TranslationUnitIssueTest.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
TranslationUnitIssueTest.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Extension\Translate\PageTranslation
;
use
InvalidArgumentException
;
use
MediaWikiUnitTestCase
;
/**
* @author Niklas Laxström
* @license GPL-2.0-or-later
* @covers \MediaWiki\Extension\Translate\PageTranslation\TranslationUnitIssue
*/
class
TranslationUnitIssueTest
extends
MediaWikiUnitTestCase
{
public
function
testConstructor
()
{
$actual
=
new
TranslationUnitIssue
(
TranslationUnitIssue
::
WARNING
,
'key'
,
[
'param1'
]
);
$this
->
assertInstanceOf
(
TranslationUnitIssue
::
class
,
$actual
);
$this
->
expectException
(
InvalidArgumentException
::
class
);
new
TranslationUnitIssue
(
'essay'
,
'key'
);
}
public
function
testGetSeverity
()
{
$expected
=
TranslationUnitIssue
::
WARNING
;
$issue
=
new
TranslationUnitIssue
(
$expected
,
'key'
);
$this
->
assertEquals
(
$expected
,
$issue
->
getSeverity
()
);
}
public
function
testGetKey
()
{
$expected
=
'key'
;
$issue
=
new
TranslationUnitIssue
(
TranslationUnitIssue
::
ERROR
,
$expected
);
$this
->
assertEquals
(
$expected
,
$issue
->
getKey
()
);
}
public
function
testGetParams
()
{
$expected
=
[];
$issue
=
new
TranslationUnitIssue
(
TranslationUnitIssue
::
ERROR
,
'key'
);
$this
->
assertEquals
(
$expected
,
$issue
->
getParams
(),
'default value'
);
$expected
=
[
'param1'
];
$issue
=
new
TranslationUnitIssue
(
TranslationUnitIssue
::
ERROR
,
'key'
,
$expected
);
$this
->
assertEquals
(
$expected
,
$issue
->
getParams
()
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 12:03 (15 h, 52 m ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
03/3a/804f5f027f5f8581472247e2b3cc
Default Alt Text
TranslationUnitIssueTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment