MediaWiki
REL1_31
JSONReaderTest.php
Go to the documentation of this file.
1
<?php
8
namespace
LocalisationUpdate
;
9
13
class
JSONReaderTest
extends
\PHPUnit\Framework\TestCase {
17
public
function
testParse
(
$input
, $expected, $comment ) {
18
$reader =
new
JSONReader
(
'xx'
);
19
$observed = $reader->parse(
$input
);
20
$this->assertEquals( $expected, $observed[
'xx'
], $comment );
21
}
22
23
public
function
parseProvider
() {
24
return
[
25
[
26
'{}'
,
27
[],
28
'empty file'
,
29
],
30
[
31
'{"key":"value"}'
,
32
[
'key'
=>
'value'
],
33
'file with one string'
,
34
],
35
[
36
'{"@metadata":{"authors":["Nike"]},"key":"value2"}'
,
37
[
'key'
=>
'value2'
],
38
'@metadata is ignored'
,
39
]
40
];
41
}
42
}
LocalisationUpdate\JSONReaderTest
\LocalisationUpdate\JSONReader
Definition
JSONReaderTest.php:13
LocalisationUpdate\JSONReaderTest\testParse
testParse( $input, $expected, $comment)
parseProvider
Definition
JSONReaderTest.php:17
LocalisationUpdate\JSONReaderTest\parseProvider
parseProvider()
Definition
JSONReaderTest.php:23
LocalisationUpdate\JSONReader
Reads MediaWiki JSON i18n files.
Definition
JSONReader.php:13
LocalisationUpdate
Definition
Fetcher.php:8
$input
if(is_array($mode)) switch( $mode) $input
Definition
postprocess-phan.php:145
extensions
LocalisationUpdate
tests
phpunit
reader
JSONReaderTest.php
Generated on Mon Nov 25 2024 15:34:20 for MediaWiki by
1.10.0