MediaWiki REL1_33
JSONReaderTest.php
Go to the documentation of this file.
1<?php
8namespace LocalisationUpdate;
9
13class 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}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
\LocalisationUpdate\JSONReader
testParse( $input, $expected, $comment)
parseProvider
Reads MediaWiki JSON i18n files.
if(is_array($mode)) switch( $mode) $input